diff options
author | drh <drh@noemail.net> | 2014-02-10 16:13:42 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2014-02-10 16:13:42 +0000 |
commit | b373591c5e7e976e6e6779c027662f99ce02df22 (patch) | |
tree | e2b151888c4b947bff39bf657d1d21dcca91ed35 /src | |
parent | 60830e3c535f080a4c63ed73b7ba2c5108265d49 (diff) | |
download | sqlite-b373591c5e7e976e6e6779c027662f99ce02df22.tar.gz sqlite-b373591c5e7e976e6e6779c027662f99ce02df22.zip |
Modify the command-line shell to print a warning when using an in-memory
database.
FossilOrigin-Name: 90e9deae4a2bf63308a212226314aa7838c161d9
Diffstat (limited to 'src')
-rw-r--r-- | src/shell.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/shell.c b/src/shell.c index 8fa32105d..395cf30b2 100644 --- a/src/shell.c +++ b/src/shell.c @@ -3520,6 +3520,7 @@ int main(int argc, char **argv){ char *zFirstCmd = 0; int i; int rc = 0; + int warnInmemoryDb = 0; if( strcmp(sqlite3_sourceid(),SQLITE_SOURCE_ID)!=0 ){ fprintf(stderr, "SQLite header and source version mismatch\n%s\n%s\n", @@ -3614,6 +3615,7 @@ int main(int argc, char **argv){ if( data.zDbFilename==0 ){ #ifndef SQLITE_OMIT_MEMORYDB data.zDbFilename = ":memory:"; + warnInmemoryDb = 1; #else fprintf(stderr,"%s: Error: no database filename specified\n", Argv0); return 1; @@ -3754,6 +3756,13 @@ int main(int argc, char **argv){ "Enter SQL statements terminated with a \";\"\n", sqlite3_libversion(), sqlite3_sourceid() ); + if( warnInmemoryDb ){ + printf( + "Warning: connected to an in-memory database. " + "Use \".open FILENAME\" to change\nto a persistent " + "on-disk database.\n" + ); + } zHome = find_home_dir(); if( zHome ){ nHistory = strlen30(zHome) + 20; |