SQLite C++ Wrapper
SQLite C++ Wrapper 是一个 C++ 语言对 SQLite 的最小封装包。
示例代码1:
#include <string>
#include <iostream>
#include <stdexcept>
using namespace std;
#include "sqlite3x.hpp"
using namespace sqlite3x;
int main(void) {
try {
sqlite3_connection con("test.db");
int count = con.executeint(
"select count(*) "
"from sqlite_master "
"where name='t_test';");
if(count == 0) {
con.executenonquery(
"create table t_test(number,string);");
}
sqlite3_transaction trans(con);
{
sqlite3_command cmd(con,
"insert into t_test values(?,?);");
cmd.bind(2, "foobar", 6);
for(int i = 0; i < 10000; ++i) {
cmd.bind(1, i);
cmd.executenonquery();
}
}
// if trans goes out of scope (due to an exception or
// anything else) before calling commit(), it will
// automatically rollback()
trans.commit();
}
catch(exception &ex) {
cerr << "Exception Occured: " << ex.what() << endl;
}
return 0;
}
示例代码2:
#include <iostream>
#include <stdexcept>
using namespace std;
#include "sqlite3x.hpp"
using namespace sqlite3x;
int main(void) {
try {
sqlite3_connection con("test.db");
sqlite3_command cmd(con, "select * from t_test;");
sqlite3_reader reader = cmd.executereader();
while(reader.read()) {
cout << reader.getcolname(0) << ": "
<< reader.getint(0) << endl;
}
}
catch(exception &ex) {
cerr << "Exception Occured: " << ex.what() << endl;
}
return 0;
}
评论
SQLite Manager
这是一款方便firefox对任何SQLite数据库操作的扩展。使用这款扩展,可以在firefox下很容易的创建表格、建立索引、浏览搜索等操作。此外它还具有一个语法检查功能的下拉式菜单,从而保证用户的操
SQLite Manager
0
SQLite for Delphi
SQLite的一个Delphi的开源封装库,全面支持Delphi4,5,6,7,2005和2006。对于Delphi4和Delphi5请使用带有D4、D5后缀的文件。解压缩下载回来的文件包到Delph
SQLite for Delphi
0
fish-nvmnvm wrapper for fish-shell
fish-nvmNVM wrapper for fish-shell.InstallMake sur
fish-nvmnvm wrapper for fish-shell
0
fish-nvmnvm wrapper for fish-shell
fish-nvmNVMwrapperforfish-shell.InstallMakesureyouhaveNVMinstalledfirst.WithFisherfisherinstallFabio
fish-nvmnvm wrapper for fish-shell
0