Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision |
howtos:sqlite_tutorial [2009/03/08 13:49] – sqlite.exe only applies to old versions of POPFile xuesheng | howtos:sqlite_tutorial [2013/10/25 14:52] (current) – external edit 127.0.0.1 |
---|
**'sqlite'** is a command-line program to administer SQLite 2.x databases as used by POPFile 0.21.0 to 1.0.1. This utility is called **''sqlite.exe''** or **''sqlite''** depending upon the platform. For simplicity this tutorial refers to the utility as **''sqlite''**. | **'sqlite'** is a command-line program to administer SQLite 2.x databases as used by POPFile 0.21.0 to 1.0.1. This utility is called **''sqlite.exe''** or **''sqlite''** depending upon the platform. For simplicity this tutorial refers to the utility as **''sqlite''**. |
| |
* POPFile 1.1.0 (or later) uses the SQLite 3.x format for its database which requires a different command-line program (**''sqlite3.exe''** or **''sqlite3''**) and there is a [[http://www.sqlite.org/sqlite.html | tutorial]] showing how to use this SQLite 3.x format utility on the SQLite website. | ^ POPFile 1.1.0 (or later) uses the SQLite 3.x format for its database which requires a different command-line program (**''sqlite3.exe''** or **''sqlite3''**). There is a [[http://www.sqlite.org/sqlite.html | tutorial]] showing how to use this SQLite 3.x format utility on the SQLite website.^ |
| |
| |
<code bash>$ zcat ex1.dump.gz | sqlite ex2</code> | <code bash>$ zcat ex1.dump.gz | sqlite ex2</code> |
| |
The text format used is the same as used by PostgreSQL, so you can also use the **''.dump''** command to export an SQLite database into a PostgreSQL database. Like this: | The text format used is the same as used by %%PostgreSQL%%, so you can also use the **''.dump''** command to export an SQLite database into a %%PostgreSQL%% database. Like this: |
| |
<code bash> | <code bash> |
</code> | </code> |
| |
You can almost (but not quite) go the other way and export a PostgreSQL database into SQLite using the **pg_dump** utility. Unfortunately, when **pg_dump** writes the database schema information, it uses some SQL syntax that SQLite does not understand. So you cannot pipe the output of **pg_dump** directly into **''sqlite''**. But if you can recreate the schema separately, you can use **pg_dump** with the **-a** option to list just the data of a PostgreSQL database and import that directly into SQLite. | You can almost (but not quite) go the other way and export a %%PostgreSQL%% database into SQLite using the **pg_dump** utility. Unfortunately, when **pg_dump** writes the database schema information, it uses some SQL syntax that SQLite does not understand. So you cannot pipe the output of **pg_dump** directly into **''sqlite''**. But if you can recreate the schema separately, you can use **pg_dump** with the **-a** option to list just the data of a %%PostgreSQL%% database and import that directly into SQLite. |
| |
<code bash> | <code bash> |