Skip to content

Commit

Permalink
delete read file sync function
Browse files Browse the repository at this point in the history
  • Loading branch information
hassanelnajjar committed Sep 2, 2023
1 parent 9dc383d commit 109de43
Show file tree
Hide file tree
Showing 2 changed files with 217 additions and 200 deletions.
22 changes: 19 additions & 3 deletions web/database/initTestData.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
import { join } from 'path';
import { readSqlFile as readSQLFileAndQuery } from './connect.js';
import { query } from './connect.js';
import deleteAllShopifySessionsData from './shopify_sessions/deleteAllShopifySessionsData.js';

const initTestData = async () => {
await readSQLFileAndQuery(join(process.cwd(), '/web/database/build.sql'));
console.log('initTestData');
await query(
`
BEGIN;
CREATE TABLE IF NOT EXISTS shopify_sessions (
id TEXT PRIMARY KEY,
shop TEXT NOT NULL,
state TEXT NOT NULL,
"isOnline" BOOLEAN NOT NULL DEFAULT FALSE,
"accessToken" TEXT NOT NULL,
"onlineAccessInfo" TEXT,
scope TEXT,
expires INTEGER
);
COMMIT;`
);
await deleteAllShopifySessionsData();
};

Expand Down
Loading

0 comments on commit 109de43

Please sign in to comment.