-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
230 additions
and
5 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
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
36 changes: 36 additions & 0 deletions
36
js/packages/quary-extension/src/web/servicesDatabasePostgres.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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Ok } from '@shared/result' | ||
import * as postgres from 'postgres' | ||
import { ServicesDatabase } from './servicesDatabase' | ||
|
||
const DefaultDatabaseDependentSettings = { | ||
runQueriesByDefault: false, | ||
lookForCacheViews: false, | ||
} | ||
|
||
// @ts-ignore | ||
export class ServicesDatabasePostgres implements ServicesDatabase { | ||
readonly db: any | ||
|
||
// @ts-ignore | ||
async runStatement(statement: string): Promise<Result<QueryResult>> { | ||
const results = this.db` | ||
${statement} | ||
` | ||
console.log(results) | ||
throw new Error('Not implemented') | ||
} | ||
|
||
constructor() { | ||
this.db = postgres({ | ||
port: 5432, | ||
host: 'localhost', | ||
database: 'postgres', | ||
username: 'postgres', | ||
password: 'mysecretpassword', | ||
}) | ||
} | ||
|
||
async listTables() { | ||
return Ok([]) | ||
} | ||
} |
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
Oops, something went wrong.