Skip to content
Discussion options

You must be logged in to vote

You have two different in-memory databases.
Every time you connect to in-memory databese, it creates new separate database. So,

    memory_conn = sqlite3.connect(":memory:")

and

    test_engine = create_engine(
        "sqlite:///:memory:", connect_args={"check_same_thread": False}, echo=True
    )

are two different databases. And you copy data only to first of them, but trying to use the second.

From the SQLite documentation:

In-memory Databases And Shared Cache

In-memory databases are allowed to use shared cache if they are opened using a URI filename. If the unadorned ":memory:" name is used to specify the in-memory database, then that database always has a private cache and is only…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@nachitox
Comment options

@mgreene2
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by YuriiMotov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem
5 participants