Api herhangi dökümü fonksiyonunu (http://www.sqlite.org/capi3ref.html) sahip görünmüyor, ancak ederek dökümü oluşturabilirsiniz:
Yeni bir fonksiyon yaratma olduğunu *
SQLite kaynak kodunda sağlanan dökümü işlevini kullanın Dosya sqlite3_exec()
veya sqlite3_get_table()
sizin tampon sonucunu kullanmak ve onu dökümü olacak, onu (shell.c
) 'de bulabilirsiniz.
Düzenleme: bunun için önceden yapılmış aletler varsa bilmiyorum, ama bunu kendiniz uygulayabilirsiniz bu numuneyi
/* TODO : This is just a sample code, modify it to meet your need */
void select_and_dump_sqlite3_table(sqlite3 *dbh)
{
FILE *dump_file;
int i;
sqlite3_stmt *stmt;
dump_file = fopen(path_to_dump_file, "w");
if (dump_file == NULL) {
/* Error handling with errno and exit */
}
sqlite3_prepare_v2(dbh, "SELECT name, address, phone FROM Person",
0, &stmt, NULL);
/* dump columns names into the file */
for (i = 0; i < 3; i++) {
fprintf (dump_file, "%30s | ", sqlite3_column_name(stmt, i));
}
printf ("\n");
/* Dump columns data into the file */
while (SQLITE_ROW == sqlite3_step(stmt)) {
for (i = 0; i < 3; i++) {
fprintf (dump_file, "%30s | ", sqlite3_column_text (stmt, i));
}
printf ("\n");
}
/* We're ready to leave */
sqlite3_finalize (stmt);
}
D'oh! [Bu soru] konusuna bakın (http://stackoverflow.com/questions/75675/how-do-i-dump-the-data-of-some-sqlite3-tables). –