What executes SQL commands submitted by an application program, if no DBMS is running?

橙三吉。 提交于 2020-01-15 10:33:45

问题


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:


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.



来源:https://stackoverflow.com/questions/51327962/what-executes-sql-commands-submitted-by-an-application-program-if-no-dbms-is-ru

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!