You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduced SqliteDropCreateDatabaseAlways and SqliteCreateDatabaseIfNotExists. Renamed SqliteContextInitializer to SqliteInitializerBase and modified the visibility to internal.
Copy file name to clipboardExpand all lines: README.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# SQLite CodeFirst
2
2
Creates a [SQLite Database](https://sqlite.org/) from Code, using [Entity Framework](https://msdn.microsoft.com/en-us/data/ef.aspx) CodeFirst.
3
3
4
-
This Project ships a `SqliteContextInitializer` which creates a new SQLite Database, based on your model/code.
4
+
This Project ships several `IDbInitializer` which creates a new SQLite Database, based on your model/code.
5
5
I started with the [code](https://gist.github.com/flaub/1968486e1b3f2b9fddaf) from [flaub](https://github.com/flaub).
6
6
7
7
Currently the following is supported:
@@ -13,38 +13,38 @@ Currently the following is supported:
13
13
- Auto increment (An int PrimaryKey will automatically be incremented)
14
14
15
15
I tried to write the code in a extensible way.
16
-
The logic is devided into two main parts. Builder and Statement.
16
+
The logic is divided into two main parts. Builder and Statement.
17
17
The Builder knows how to translate the EdmModel into statements where a statement class creates the SQLite-DDL-Code.
18
18
The structure of the statements is influenced by the [SQLite Language Specification](https://www.sqlite.org/lang.html).
19
19
You will find an extensive usage of the composite pattern.
20
20
21
21
## How to use
22
-
If you want to let the Entity Framework create the database, if it does not exist, just set `SqliteContextInitializer<>` as your `IDbInitializer`.
22
+
If you want to let the Entity Framework create the database, if it does not exist, just set `SqliteDropCreateDatabaseAlways<>` or `SqliteCreateDatabaseIfNotExists` as your `IDbInitializer`.
In a more advanced szenario you may want to populate some core- or test-data after the database was created.
39
-
To do this, inherit from `SqliteContextInitializer<>` and override the `Seed(TestDbContext context)` function.
38
+
In a more advanced scenario you may want to populate some core- or test-data after the database was created.
39
+
To do this, inherit from `SqliteDropCreateDatabaseAlways<>`or `SqliteCreateDatabaseIfNotExists`and override the `Seed(MyDbContext context)` function.
40
40
This function will be called, in a own transaction, right after the database was created. This function is only executed if a new database was successfully created.
0 commit comments