data-source-introspector
v0.0.3
Published
To install all of the template files, run the following script from the root of your project's directory:
Downloads
5
Readme
Installation
To install all of the template files, run the following script from the root of your project's directory:
npm i data-source-introspector
data-source-introspector
Description: data-source-introspector is a tool designed for introspecting (get table & fields info) for popular data sources like
Airtable
,Postgres
and others (coming soon)Technology stack:
- TS
- NodeJS
Status: This project in Alpha version.
Dependencies
For running this project need to be installed following deps
├── @types/[email protected]
├── @types/[email protected]
├── @typescript-eslint/[email protected]
├── @typescript-eslint/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
Usage
For introspection ane data source we need to do this three common steps:
- Define connection details to data source:
const postgresConnectionDetails: PostgresConnectionDetails = {
user: 'myUser',
port: 0,
host: 'myHost',
password: 'myPassword',
// ---- OR ----
connectionString: 'myConnectionString',
};
- Create instance of data source introspector &
init()
them.
const pgIntrospector = new PostgresIntrospector();
await pgIntrospector.init(postgresConnectionDetails);
- Call
introspect
method & pass introspection params
const pgIntrospectionResult = await pgIntrospector.introspect({
table: 'myTable',
schema: 'mySchema',
// ---- OR ----
query: 'SELECT * FROM myTable LIMIT 1',
});
console.log({ pgIntrospectionResult });
Getting help
If you have questions, concerns, bug reports, etc, please file an issue in this repository's Issue Tracker
Contributing
General instructions on how to contribute to this project can be founded here.