作者:MrTkinG | 来源:互联网 | 2023-09-06 09:41
Imadeadatabasethroughsqliteinc++.我用c++通过sqlite创建了一个数据库。Thedbhasbeencreatedinmemory
I made a database through sqlite in c++.
我用c++通过sqlite创建了一个数据库。
The db has been created in memory (using the ":memory:" parameter insted of a filename), in order to have a very quick behavior.
db已经在内存中创建(使用“:内存:”一个文件名的参数),以便有一个非常快的行为。
The database is created by the following lines:
数据库由以下几行创建:
sqlite3* mem_database;
if((SQLITE_OK == sqlite3_open(":memory:", &mem_database)){
// The db has been correctly created and
// I can do some stuff with it.
}
sqlite3_close(mem_database);
My problem is: how can I write the in-memory database to disk? (through c/c++ of course).
我的问题是:如何将内存数据库写入磁盘?(当然通过c / c++)。
I read something about the ATTACH and DETACH sqlite commands, but I can get them working only with the sqlite interactive shell (not from c/c++ code).
我读了一些关于ATTACH和DETACH sqlite命令的东西,但是我可以让它们只使用sqlite交互式shell(而不是c/c++代码)。
Greets.
问候。
2 个解决方案