tags:

views:

85

answers:

3

Hi, I is there a way to add "additional info" to a sqlite database. Something like date of creation of a database, amount of entries or name of user who created it. If I don't want to create special tables in order to store all this info especially if there will only be one of each type.

Thank you in advance.

A: 

In short, no. SQLite has no concept of users, and doesn't store creation metadata.

Don Werve
A: 

No, there is no way to do that, you will have to use a "special" table to carry data within the file, or you will have to use external means.

There are, however, two version counters stored within the database itself: the schema_version and the user_version (see Pragmas to query/modify version values for details.) Perhaps you could abuse those. Please keep in mind, though, that by default the sqlite3 shell application does not store those when you use the .dump command to dump the database into a textual representation.

Mihai Limbășan
+2  A: 

Why not use one special table and store each special value as a name-value pair?

CREATE TABLE SpecialInfoKeyValues (
    Key VARCHAR UNIQUE COLLATE NOCASE,
    Value
 );

Since SQLite uses "manifest typing," you can store any kind of value you want in there.

Steven Fisher