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
{{ message }}
This repository was archived by the owner on Feb 11, 2022. It is now read-only.
Generates java/android database access code by analysing sqlite migration files or sqlite databases, keeping full control of what code is generated.
8
+
Generates java/android database access code by analysing sqlite migration files or sqlite databases,
9
+
keeping full control of what code is generated.
8
10
9
-
sqlite-analyzer creates an in-memory sqlite database, either from a given database file or by running sql migrations, and analyzes its tables to construct a DatabaseModel. This model is then used to generate code.
11
+
sqlite-analyzer creates an in-memory sqlite database, either from a given database file or by reading sql migrations,
12
+
and analyzes its tables to construct a DatabaseModel. This model is then used to generate database access code.
10
13
11
-
This project uses [sqlite-jdbc](https://bitbucket.org/xerial/sqlite-jdbc) to create and analyze the database. [Groovy](http://groovy.codehaus.org/) is used to generate code, [Gradle](http://www.gradle.org/) to hook the functionality into the [android build system](http://tools.android.com/tech-docs/new-build-system).
14
+
This project uses [sqlite-jdbc](https://bitbucket.org/xerial/sqlite-jdbc) to create and analyze the database.
15
+
[Groovy](http://groovy.codehaus.org/) is used to generate code, [Gradle](http://www.gradle.org/) to hook
16
+
the functionality into the [android build system](http://tools.android.com/tech-docs/new-build-system).
12
17
13
18
## Adding to your project
14
19
15
-
To integrate sqliteAnalyzer into your project, it is recommended for now that you depend directly on the sources. See the setup under the
16
-
`buildSrc` sub-directory for an example.
17
-
18
-
If you prefer you can use it from jcenter directly, just add these lines to the build.gradle of your project:
20
+
To integrate sqlite-analyzer into your project, add the following at the beginning of the `build.gradle` of your project:
19
21
20
22
```groovy
21
23
buildscript {
22
24
repositories {
23
25
jcenter()
24
26
}
25
27
dependencies {
26
-
classpath 'com.novoda:sqlite-analyzer:0.2.0'
28
+
classpath 'com.novoda:sqlite-analyzer:0.3.0'
27
29
}
28
30
}
29
31
```
30
32
31
-
After you've added the sources to `buildSrc` or added the buildscript dependency, you can start using this library, add these lines to the `build.gradle` of your project:
33
+
To use the library with [sqlite-provider](https://github.com/novoda/sqlite-provider), add these lines to the `build.gradle` of your project:
32
34
33
35
```groovy
34
36
apply plugin: 'sqlite-analyzer'
@@ -39,14 +41,19 @@ sqliteAccess {
39
41
}
40
42
```
41
43
44
+
See the sample projects for setup with [android-sqlite-asset-helper](https://github.com/jgilfelt/android-sqlite-asset-helper).
45
+
42
46
43
47
## Simple usage
44
48
45
49
Try `./gradlew clean assembleDebug` and observe the generated code under `build/generated/source/sqlite/debug/`.
46
50
47
-
It contains one single class `DB` that provides access to column names of all tables and that provides model classes for all tables.
51
+
By default, it contains one single class `DB` that defines constants for the names of the tables and columns and
52
+
introduces static accessor methods as well as model classes for all tables data.
48
53
49
-
The project provides 3 demo applications that create and use database access code, using SqliteProvider, android-asset-helper and Google Auto resp.
54
+
The project comes with 2 demo applications that create and use database access code,
55
+
one uses [sqlite-provider](https://github.com/novoda/sqlite-provider),
56
+
the other uses [android-sqlite-asset-helper](https://github.com/jgilfelt/android-sqlite-asset-helper).
0 commit comments