Re: Is there a way to yield an error when opening a nonexistent dbfile?
Kees Nuyt <k.nuyt-RSh1/+X/PmFmR6Xm/[email protected]>
| Newsgroups | gmane.comp.db.sqlite.general |
|---|---|
| Message-ID | <[email protected]> |
On Fri, 31 Jan 2020 09:02:10 -0600, Peng wrote: > Hi, > > By default the command sqlite3 will just open a dbfile if it does not exist. > > Suppose that I just want to perform read-only operations in a sqlite3 > session, I will not need to create a non-exsitent file. Rather, I want > the sqlite3 to fail when the dbfile does not exist. Is there a way to > achieve this? $ sqlite3 -readonly testx.db SQLite version 3.31.1 2020-01-27 19:55:54 Enter ".help" for usage hints. sqlite> .tables Error: unable to open database "testx.db": unable to open database file -- Regards, Kees Nuyt _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users