Created
May 12, 2018 02:26
-
-
Save JoeyBodnar/930f1cff2e2637e85216177389481943 to your computer and use it in GitHub Desktop.
SQLite DB usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Configure a SQLite database | |
let sqlite = try SQLiteDatabase(storage: .memory) | |
/// Register the configured SQLite database to the database config. | |
var databases = DatabasesConfig() | |
databases.add(database: sqlite, as: .sqlite) | |
services.register(databases) | |
/// Configure migrations | |
var migrations = MigrationConfig() | |
migrations.add(model: User.self, database: .sqlite) | |
services.register(migrations) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment