Skip to content

Commit 141fb54

Browse files
authored
Update README.md
1 parent 4fa44c8 commit 141fb54

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
# cpp-sqlite3
2+
3+
24
//初始化sqlite3_delegate对象,模板类型为数据库表每列的数据类型
5+
36
sqlite_tool::sqlite3_delegate<sqlite_tool::integer, sqlite_tool::real, sqlite_tool::char_string, sqlite_tool::data_string> sq_delegate;
7+
48
//设置数据库文件路径
9+
510
sq_delegate.set_db_file_path(std::string("your db file path"));
11+
612
//设置数据库表(table)名称
13+
714
sq_delegate.set_table_name(std::string("your table name"));
15+
816
//设置表中每一列(column)的名称
17+
918
sq_delegate.set_column_names(std::string("int_col"), std::string("real_col"), std::string("text_col"), std::string("blob_col"));
19+
1020
//创建表
21+
1122
sq_delegate.create_table_if_not_exists();
1223

1324
//通过表中列的序号(column index)插入数据

0 commit comments

Comments
 (0)