-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cli: Add cardano-wallet --database option #374
Conversation
embedFile wasn't working for me in ghci. lib/cli/src/Cardano/CLI.hs:275:27: error: • Exception when trying to run compile-time code: ../../cardano-wallet.cabal: openBinaryFile: does not exist (No such file or directory) Code: embedFile "../../cardano-wallet.cabal" • In the untyped splice: $(embedFile "../../cardano-wallet.cabal") | 275 | let cabal = B8.unpack $(embedFile "../../cardano-wallet.cabal") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ There is another easier way to get the program version (assuming all cabal files have the same version).
Changes the DBLayer to use SQLite. Without a given filename, it just uses the in-memory database.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without a given filename, it just uses the in-memory database.
Just to confirm that my understanding is correct, is this in-memory database supposed to be in-memory-SQLite?
I found the following snippet:
createSqliteBackend :: Maybe FilePath -> LogFunc -> IO SqlBackend
createSqliteBackend fp logFunc = do
conn <- Sqlite.open (sqliteConnStr fp)
enableForeignKeys conn
wrapConnection conn logFunc
sqliteConnStr :: Maybe FilePath -> Text
sqliteConnStr = maybe ":memory:" T.pack
With this change, is there any way to specify the MVar
database on startup? (Not sure if we want to keep it around.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without a given filename, it just uses the in-memory database.
Just to confirm that my understanding is correct, is this in-memory database supposed to be in-memory-SQLite?
I found the following snippet:
createSqliteBackend :: Maybe FilePath -> LogFunc -> IO SqlBackend
createSqliteBackend fp logFunc = do
conn <- Sqlite.open (sqliteConnStr fp)
enableForeignKeys conn
wrapConnection conn logFunc
sqliteConnStr :: Maybe FilePath -> Text
sqliteConnStr = maybe ":memory:" T.pack
With this change, is there any way to specify the MVar
database on startup? (Not sure if we want to keep it around.)
It would be nice to add integration test for |
Closing in favor of #377 @piotr-iohk -> Will enable integration tests on the file-based SQLite in another PR. |
Issue number #154
This PR is based on the branch of #373
Overview