question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Does this support in-memory database?

See original GitHub issue

I got SQLite.SQLiteException when I tried var db = new SQLiteConnection("Data Source=:memory:");

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:15 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
paul-kiarcommented, Jun 10, 2021

The work around:

       public const SQLite.SQLiteOpenFlags DefaultFlags =
                    // open the database in memory
                    (SQLiteOpenFlags)0x00000080 | 
                    // open the database in read/write mode
                    SQLite.SQLiteOpenFlags.ReadWrite |
                    // create the database if it doesn't exist
                    SQLite.SQLiteOpenFlags.Create |
                    // enable multi-threaded database access
                    SQLite.SQLiteOpenFlags.SharedCache;
1reaction
mkonstapelcommented, Dec 17, 2016

Is it possible to open multiple connections to an in-memory DB? According to https://www.sqlite.org/inmemorydb.html, the connection string should be either "file::memory:?cache=shared" for a single in-memory database or "file:memdb1?mode=memory&cache=shared" for one or more named in-memory databases.

However, the first throws an exception:

SQLiteException: Could not open database file: file::memory:?cache=shared (CannotOpen)

and the second creates a file-based db in a file called file. This is apparently taken from the URI, because it creates a file called foo if I change it to "foo:memdb1?mode=memory&cache=shared".

Read more comments on GitHub >

github_iconTop Results From Across the Web

What Is an In-Memory Database?
In-memory databases are purpose-built databases that rely primarily on memory for data storage, in contrast to databases that store data on disk or...
Read more >
In-Memory Databases Explained
An in-memory database is a data storage software that holds all of its data in the memory of the host. The main difference...
Read more >
List of in-memory databases
Name Developer Availability Aerospike DBS Aerospike Company 2012 ALTIBASE HDB Altibase Corporation 1999 ALTIBASE XDB Altibase Corporation 1999
Read more >
List of Top In-Memory Databases 2023
In-memory databases (IMDBs), sometimes called in-memory data stores, are database systems that store, read, write, and access data in random access memory (RAM) ......
Read more >
A Guide to In-Memory Databases
MySQL is one of the most popular relational databases available and has built-in support to create specific tables that will be stored in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found