it seems to be looking for the connection URL, which isn't available because Open was not called?
The reason why I'm trying to do this is because I have a database migration tool which is in charge of creating tables, etc, but since database is in memory, if I close the sql.DB handle that I used to run the migrations, the database is lost.
I have figured out a solution for that problem (use sqlite.ParseURL to obtain a ConnectionURL, use the resulting DSN with sql.Open, and pass it as the settings argument to sqlite.Openbefore closing the connection, so that the database is reused). What I'm wondering here is if the above program is supposed to work or not, and if not, why not?
reading the docs for sqlite.New, I'm not sure if I'm misunderstanding the docs, or if there's a bug.
From the function signature I expect this code to work:
but it does in fact panic:
it seems to be looking for the connection URL, which isn't available because Open was not called?
The reason why I'm trying to do this is because I have a database migration tool which is in charge of creating tables, etc, but since database is in memory, if I close the
sql.DB
handle that I used to run the migrations, the database is lost.I have figured out a solution for that problem (use
sqlite.ParseURL
to obtain aConnectionURL
, use the resulting DSN withsql.Open
, and pass it as the settings argument tosqlite.Open
before closing the connection, so that the database is reused). What I'm wondering here is if the above program is supposed to work or not, and if not, why not?