What executes SQL commands submitted by an applica

2019-08-06 09:10发布

When you are writing a program which uses a database driver, from Why is programming interface to database called driver?

There are databases that allow you to embed them within your process (like sqlite), but if you're working with a database that has its own process[es] (like postgresql), then yes, it(they) must be up and running in order to work against that database.

So some databases "allow you to embed them within your process (like sqlite)". If there is no DMBS running, to what does your process submit a SQL command, and what parses and executes the SQL command? (For example, in SQLite case.)

Does your application work, both when SQLite is running and when not?

1条回答
兄弟一词,经得起流年.
2楼-- · 2019-08-06 09:41

The SQLite documentation says:

SQLite is an in-process library […]
SQLite is an embedded SQL database engine. Unlike most other SQL databases, SQLite does not have a separate server process. SQLite reads and writes directly to ordinary disk files.

When you call a function like sqlite3_exec(), this function directly parses and executes the SQL. The code for all this is contained in the SQLite library, which usually is statically linked into your application, i.e., it is part of your application process.

查看更多
登录 后发表回答