4 ms·
> No! SQLite is not an embedded RDBMS. It's a file format. You keep saying it's a file format, but it's quite possible to use sqlite without persisting anythin
by catalogia 7y ago
> No! SQLite is not an embedded RDBMS. It's a file format.
You keep saying it's a file format, but it's quite possible to use sqlite without persisting anything to a file at all.
rc = sqlite3_open(":memory:", &db);
- bane 7y agoYou can read/write CSV files, JSON, JPEG, WAV, MP3, MP4, etc. into memory as well. That doesn't make any of them an RDBMS. SQLite is a file format. It has a nice API and uses SQL as the domain language for read/write logic. If it didn't use SQL for the logic, would you still be confused?
- catalogia 7y agoBeing a file format is only one aspect of what SQLite is. SQLite describes itself as "SQLite is a C-language library that implements a small, fast, self-contained, high-reliability, full-featured, SQL database engine." I think that is a better, more encompassing, description than "it's a file format" Edit: If SQLite lacked any ability to persist data to disk, it would still be very useful as an in-process SQL engine for many sorts of problems. Certainly not as useful as it currently is, but nevertheless still useful. I'd say the file format without the SQL engine, or the SQL engine without the file format, would be like peanut-butter without jelly. Certainly not pointless, but the real magic comes from the combination of the two.
- bane 7y agoSure, I can get behind that. The logic that handles the read/writing and SQL parsing is all part of the library for sure. But that library is absolutely not required nor is SQL. One could build their own library that read/write to SQLite files entirely without any of that if they wished. Some people have done ground up rewrites in other languages other than C, but have more or less stuck with the same internal logic and the use of SQL as the read/write logic.
- cma 7y agoSQLite is a whole library with complicated locking protocol options etc. and works with multiple files of different formats (e.g. separate transaction log).
- bane 7y agoSince the file format specification is available, you can write your own code that directly reads/writes to SQLite files. You can't even have to use the logs and journaling options. You don't even have to use SQL.
- cma 7y agoThat’s the SQLite database file format. SQLite itself is a library that can deal with multiple files in different formats (transaction log and database file). It also reads .sqliterc and maybe others.
- bane 7y ago> That’s the SQLite database file format. You got it! SQLite is a file format. > SQLite itself is a library that can deal with multiple files in different formats (transaction log and database file). It also reads .sqliterc and maybe others. Yup you also got it! SQLite is not an RDBMS and shouldn't be approached that way. The more you try to ram RDBMS ideas into what SQLite is, the more it won't be that. The more you try to treat it like a file format, the more it will be what you want.
- wvenable 7y agoAll other RDBMS products also store their information inside files. I can take a mdb file from SQL Server and copy it to another server and attach it there. SQLite is obviously a library that stores it's data to a file like millions of other libraries. SQLite is to it's data file the way LAME is to MP3. LAME is not the file format, it's the library.
- bane 7y ago> All other RDBMS products also store their information inside files. No they don't. There are many RDBMS (and other DBMSs) that do not store their information inside files. > I can take a mdb file from SQL Server and copy it to another server and attach it there. Yes, SQL Server is an RDBMS. MDB files are files defined by a file format. This format defines something called a database. There are many libraries and other pieces of software than can read/write mdb files (https://jackcess.sourceforge.io/ https://jackcess.sourceforge.io/) SQLite files are files defined by a file format (https://www.sqlite.org/fileformat.html https://www.sqlite.org/fileformat.html). You can write code that reads and writes to a SQLite database file without using the library. So long as you follow the format specification, you will produce or be able to read from an aribtrary sqlite file that is produced by any code that implements the specification. The SQLite library is a reference implementation of the specification as well as some sample logic for reading/writing to the files and using SQL to define the interactions with the file. The SQLite library is not required for this, nor is SQL, nor is the logic for ACID compliance. SQLite is not an RDBMS and offers almost nothing that an RDBMS (or DBMS) might offer. If you wish to use SQLite files with an RDBMS you either have to build the RDBMS yourself, or find somebody else who's done so. The more you consider the SQLite a file format, the easier it becomes to work with and understand. The more you try to consider it an RDBMS the less it makes sense. Just because SQL is involved, doesn't mean it's an RDBMS.
- tracker1 7y agoSQLite is a a library the implements an embedded database engine. The file that it stores this data in is an artifact, not the interface.