2

sqlite3的新手。

如果我的理解有误,请纠正我?

sqlite3_open ( 文件名, &dbConnection) ->

1) This API creates an database [ie: filename], if it does not exists, and sets
the context to dbConnection. 
2) If the database exists already it just sets the context to dbConnection. 

情况 (1) 和 (2) 都返回 SQLITE_OK。

问题:如果数据库是第一次创建的,现在是否有可能过滤?

例如: sqlite3_open (... ) if (第一次创建数据库) { create table }

一种可能性是检查文件是否存在,但我不想这样做。sqlite3本身的任何替代方式?

4

1 回答 1

0

如果不存在语法,您可以使用创建表。

Sqlite 创建表

于 2012-09-28T05:13:23.000 回答