Skip to content

Commit f63e219

Browse files
committed
v.0.0.1
1 parent b132d18 commit f63e219

18 files changed

+657
-0
lines changed

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Specifies intentionally untracked files to ignore when using Git
2+
# http://git-scm.com/docs/gitignore
3+
4+
*~
5+
*.sw[mnpcod]
6+
*.log
7+
*.tmp
8+
*.tmp.*
9+
log.txt
10+
*.sublime-project
11+
*.sublime-workspace
12+
.vscode/
13+
npm-debug.log*
14+
15+
.idea/
16+
.sass-cache/
17+
.tmp/
18+
.versions/
19+
20+
node_modules/
21+
22+
.DS_Store
23+
Thumbs.db
24+
UserInterfaceState.xcuserstate
25+
26+
*.js
27+
*.d.ts

.npmignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
!lib
2+
node_modules
3+
.vscode
4+
*.log
5+
*.ignorenpm
6+
tsconfig.json
7+
showcase
8+
9+
# ignore the .ts files
10+
*.ts
11+
12+
# include the .d.ts files
13+
!*.d.ts

CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Contributing
2+
3+
Have you found a bug, or want to develop a new feature?
4+
5+
1. [Look for Pull Requests](https://github.com/fernandocode/database-builder/pulls) if something is not already implemented;
6+
2. [Check if there is no Issue related to this](https://github.com/fernandocode/database-builder/issues)? (If there is not one, so that the use case can be checked);
7+
3. Make the necessary changes, add tests to what has been implemented, run the tests and submit a Pull Request with the changes (Comment what was done, and relate the Issue). As soon as possible it will be verified, and if approved it will be available in the next release of the library.

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Fernando Leal
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

package.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"name": "ionic-database-builder",
3+
"version": "0.0.1",
4+
"description": "Extended library from database-builder to assist in creating and maintaining SQL commands with integrate execute commands in SQLite ('@ionic-native/sqlite').",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "tsc & mocha src/**/*.spec.js"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/fernandocode/ionic-database-builder.git"
12+
},
13+
"keywords": [
14+
"orm",
15+
"database",
16+
"builder",
17+
"database-builder",
18+
"sqlite",
19+
"sql",
20+
"sql-builder",
21+
"crud",
22+
"insert",
23+
"update",
24+
"delete",
25+
"select",
26+
"ddl",
27+
"create-table",
28+
"drop-table",
29+
"alter-table",
30+
"ionic"
31+
],
32+
"author": "Fernando Leal",
33+
"license": "MIT",
34+
"bugs": {
35+
"url": "https://github.com/fernandocode/ionic-database-builder/issues"
36+
},
37+
"homepage": "https://github.com/fernandocode/ionic-database-builder#readme",
38+
"dependencies": {
39+
"@angular/core": "^5.2.7",
40+
"@ionic-native/android-permissions": "^4.5.3",
41+
"@ionic-native/core": "^4.5.3",
42+
"@ionic-native/sqlite": "^4.5.3",
43+
"database-builder": "0.0.18",
44+
"ionic-angular": "^3.9.2",
45+
"rxjs": "^5.5.6",
46+
"zone.js": "^0.8.20"
47+
}
48+
}

src/database.module.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { Observable } from "rxjs";
2+
import { ModuleWithProviders, NgModule } from "@angular/core";
3+
import { DatabaseHelperService } from "./utils/database-helper-service";
4+
5+
@NgModule({
6+
declarations: [
7+
// declare all components that your module uses
8+
// MyComponent
9+
],
10+
exports: [
11+
// export the component(s) that you want others to be able to use
12+
// MyComponent
13+
]
14+
})
15+
export class DatabaseModule {
16+
// https://stackblitz.com/edit/ionic-j3f3ym
17+
public static forRoot(): ModuleWithProviders {
18+
return {
19+
ngModule: DatabaseModule,
20+
providers: [DatabaseHelperService]
21+
};
22+
}
23+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
import { InjectionToken } from "@angular/core";
3+
4+
export const VERSION = new InjectionToken<number>("version");
5+
export const DATABASE_NAME = new InjectionToken<string>("database_name");

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
export * from "./database.module";

src/model/version-model.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export interface Version {
2+
oldVersion: number;
3+
newVersion: number;
4+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { Version } from "./../model/version-model";
2+
import { Observable } from "rxjs/Observable";
3+
4+
export interface DatabaseMigrationContract {
5+
6+
to(version: Version): Array<Observable<any>>;
7+
}

0 commit comments

Comments
 (0)