SQLite Forum

how to use in-memory with shared cache in mybatis
Login
Thanks Gunter. Here is the working one according to your suggestion.

```java
db.env=localdb
db.driver=org.sqlite.JDBC
db.url=jdbc:sqlite:file::memory:?cache=shared
db.username=
db.password=
```

And to double confirm, i checked the implementation of SQLite library used
```java
<dependency>
                <groupId>org.xerial</groupId>
                <artifactId>sqlite-jdbc</artifactId>
                <version>3.28.0</version>
            </dependency>
```
Here is the snippet. For my case, it seems the URI would be passed through to sqlite3_open function (or i guess so)

```java
public final synchronized void open(String file, int openFlags) throws SQLException {
        this._open(file, openFlags);
        this.closed.set(false);
        if (this.fileName.startsWith("file:") && !this.fileName.contains("cache=")) {
            this.shared_cache(this.config.isEnabledSharedCache());
        }

        this.enable_load_extension(this.config.isEnabledLoadExtension());
        this.busy_timeout(this.config.getBusyTimeout());
    }
```