-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #325 from JYC333/action
FIx Github actions
- Loading branch information
Showing
20 changed files
with
1,257 additions
and
524 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
bin/create-anonymization-script.js → bin/create-anonymization-script.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/usr/bin/env node | ||
|
||
const anonymizationService = require('../src/services/anonymization'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
import anonymizationService from '../src/services/anonymization.js'; | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
|
||
fs.writeFileSync(path.resolve(__dirname, 'tpl', 'anonymize-database.sql'), anonymizationService.getFullAnonymizationScript()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import Database, { Database as DatabaseType } from "better-sqlite3"; | ||
|
||
let dbConnection: DatabaseType; | ||
|
||
const openDatabase = (documentPath: string) => { dbConnection = new Database(documentPath, { readonly: true }) }; | ||
|
||
const getRow = (query: string, params: string[] = []): Record<string, any> => dbConnection.prepare(query).get(params) as Record<string, any>; | ||
const getRows = (query: string, params = []) => dbConnection.prepare(query).all(params); | ||
const getValue = (query: string, params: string[] = []) => dbConnection.prepare(query).pluck().get(params); | ||
const getColumn = (query: string, params: string[] = []) => dbConnection.prepare(query).pluck().all(params); | ||
|
||
export default { | ||
openDatabase, | ||
getRow, | ||
getRows, | ||
getValue, | ||
getColumn | ||
}; |
Oops, something went wrong.