SQLite Forum

C/C++ API: Is it posiible to clone database connection?
Login
> This must be a pretty stupid user to have such unrealistic expectations

Take a look to most popular SQLite GUIs "SQLite Studio" and "DB Browser for SQLite". They both have tabs. If I attach a database in a one tab-editor then I can referenced to it in an another tab.

DB Browser obviously uses a one connection, so it can't perform queries in parallel (GUI suggests to interrupt the running query and run current one).

SQLite Studio uses some tricky mode.

1. On the first tab I run `begin; create table t (id integer, data text);`<br>
   On the second tab I execute `rollback` and the table `t` is disappeared.<br>Looks like a serialized thread mode with the one shared connection.
2. On the first tab I run `begin; create table t (id integer, data text); WITH RECURSIVE t(x) AS (SELECT 1 UNION ALL SELECT x+1 FROM t LIMIT 10000) ...;`<br>
   On the second tab I execute `rollback`. It's freezing until the long time query will be completed. And after that the table `t` will be disappeared. Serialized mode!<br>But in the same time Studio can stop two different long time queries in different tabs separately.