FrozenHeart FrozenHeart - 8 months ago 39
C++ Question

SQLite C interface doesn't create sqlite_master table

It seems that SQLite C interface create database that doesn't contain

table described in the documentation:

From within a C/C++ program (or a script using Tcl/Ruby/Perl/Python
bindings) you can get access to table and index names by doing a
SELECT on a special table named "SQLITE_MASTER". Every SQLite database
has an SQLITE_MASTER table that defines the schema for the database

The following code creates a database that doesn't contain such table (
command returns nothing):

#include <sqlite3.h>

int main()
sqlite3* db;
sqlite3_open("helper.db", &db);

Why? What should I do to create it?


The .tables command does not show any of the internal tables, but they do exist:

sqlite> create table t(x);
sqlite> .tables
sqlite> select * from sqlite_master;
table|t|t|2|CREATE TABLE t(x)