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
1 parent
b637efb
commit 510dbc2
Showing
13 changed files
with
491 additions
and
115 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { getConnectedConnectorFromCredentials } from './introspect/util' | ||
import { DatabaseType } from 'prisma-datamodel' | ||
import { isdlToDatamodel2 } from '@prisma/photon' | ||
|
||
async function main() { | ||
const { connector, disconnect } = await getConnectedConnectorFromCredentials({ | ||
type: DatabaseType.postgres, | ||
uri: | ||
'postgresql://prisma:qd58rcCywPRS4Stk@introspection-database-postgres.cluster-clfeqqifnebj.eu-west-1.rds.amazonaws.com:5432/random-database1', | ||
}) | ||
|
||
const schemas = await connector.listSchemas() | ||
console.log(schemas) | ||
const result = await connector.introspect('public') | ||
console.log(result) | ||
const isdl = result.getDatamodel() | ||
console.log(isdl) | ||
const dmmf = await isdlToDatamodel2(isdl, []) | ||
console.log(dmmf) | ||
|
||
disconnect() | ||
} | ||
|
||
main() |
Oops, something went wrong.