Browse Source

Small refactoring of database functions

master
GabrielTrettel 4 years ago
parent
commit
1f3347a705
  1. 13
      src/app/database/database-init.js

13
src/app/database/database-init.js

@ -1,11 +1,11 @@
import init_queries from "./db"; import init_queries from "./db";
/* initDatabase(db)
/* createAllTables(db)
* *
* Creates all tables from `db.js` file into * Creates all tables from `db.js` file into
* db arg. * db arg.
*/ */
function initDatabase(db) {
function createAllTables(db) {
db.transaction((tx) => { db.transaction((tx) => {
init_queries.forEach((query) => { init_queries.forEach((query) => {
tx.executeSql( tx.executeSql(
@ -22,4 +22,13 @@ function initDatabase(db) {
}); });
} }
/* initDatabase(db)
*
* Initiate database with tables and forms from FeedScreens
*
*/
function initDatabase(db) {
createAllTables(db);
}
export default initDatabase; export default initDatabase;
Loading…
Cancel
Save