简体   繁体   中英

Where is the sqlite database file stored in ODB C++ Example

I am using ODB: C++ Object-Relational Mapping (ORM) from Code Synthesis for the very first time. This is a tool that seems akin to .NET EntityFramework for C# in that it allows you to perform create, read, update, and delete (CRUD) operations on a variety of relational databases through C++. I am familiarizing myself with the tool using the examples files that come with the download . I am specifically using the hello example to persist person objects through a SQLite database.

After following the setup instructions via the INSTALL and README files in the download, and executing the driver.cxx program, I see that person object changes are committed to the database via t.commit() commands in the file.

My question is: Once the program is through executing, where is the database stored? Is it stored in the Release folder where C:\\Program Files\\odb\\odb-examples-2.4.0\\hello\\Release\\driver.exe resides? Is it stored somewhere else I am overlooking?

Here is my environment setup ...

  1. OS = Windows 10 Pro
  2. IDE = Visual Studio 2015 Community
  3. SQLite = C:\\Program Files\\sqlite\\sqlite-autoconf-3090200\\sqlite3.c
  4. ODB Compiler = C:\\Program Files\\odb\\odb-2.4.0-i686-windows\\bin\\odb.exe
  5. ODB Runtime = C:\\Program Files\\odb\\libodb-2.4.0
  6. ODB Hello Example = C:\\Program Files\\odb\\odb-examples-2.4.0\\hello
  7. Example Visual Studio .sln File = C:\\Program Files\\odb\\odb-examples-2.4.0\\examples-sqlite-vc12.sln

Please let me know if I can provide more information and thanks for your help.

If you are compile original sqlite hello world example from odb, then the database is stored in your computer memory. Odb will generate it (for sqlite) if you are not specific the database file. But, when you give specific database file, example:

odb::sqlite::database db("person.db");

then you must put your person.db file resides with execute file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM