Skip to content

Commit

Permalink
Removed version, size and description args from openDatabase and move…
Browse files Browse the repository at this point in the history
…d entrypoint files in folders
  • Loading branch information
chintannp committed Mar 29, 2022
1 parent cb1be23 commit 5b19467
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 20 deletions.
7 changes: 0 additions & 7 deletions packages/datastore-storage-adapter/ExpoSQLiteAdapter.js

This file was deleted.

7 changes: 7 additions & 0 deletions packages/datastore-storage-adapter/ExpoSQLiteAdapter/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict';

if (process.env.NODE_ENV === 'production') {
module.exports = require('../dist/aws-amplify-datastore-sqlite-adapter-expo.min.js');
} else {
module.exports = require('../dist/aws-amplify-datastore-sqlite-adapter-expo.js');
}
7 changes: 0 additions & 7 deletions packages/datastore-storage-adapter/SQLiteAdapter.js

This file was deleted.

7 changes: 7 additions & 0 deletions packages/datastore-storage-adapter/SQLiteAdapter/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict';

if (process.env.NODE_ENV === 'production') {
module.exports = require('../dist/aws-amplify-datastore-storage-adapter.min.js');
} else {
module.exports = require('../dist/aws-amplify-datastore-storage-adapter.js');
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ import { CommonSQLiteDatabase, ParameterizedStatement } from '../common/types';
const logger = new Logger('ExpoSQLiteDatabase');

const DB_NAME = 'AmplifyDatastore';
const DB_DISPLAY_NAME = 'AWS Amplify DataStore SQLite Database';

// TODO: make these configurable
const DB_SIZE = 200000;
const DB_VERSION = '1.0';

/*
Expand All @@ -30,7 +25,10 @@ class ExpoSQLiteDatabase implements CommonSQLiteDatabase {
// only open database once.

if (!this.db) {
this.db = openDatabase(DB_NAME, DB_VERSION, DB_DISPLAY_NAME, DB_SIZE);
// As per expo docs version, description and size arguments are ignored,
// but are accepted by the function for compatibility with the WebSQL specification.
// Hence, we do not need those arguments.
this.db = openDatabase(DB_NAME);
}
}

Expand Down

0 comments on commit 5b19467

Please sign in to comment.