Data Source Profile
When sending an API request to query the data through SQL file logistic, also should check the data source ( e.g: Database, Warehouse ) has connected, so VulcanSQL needs you to define the Data Source Profile.
Define profile in independent YAML files
You could create independent YAML files to define data sources and set the filePath in the profiles
options of the project config:
# pg-profile.yaml
- name: pg
type: postgres
allow: '*'
connection:
host: example.com
user: vulcan
password: secret
database: vulcan
port: 5432
------------------------------------
# duck-profile.yaml
name: duck
type: duckdb
connection:
persistent-path: ./test-data/moma.db
log-queries: true
log-parameters: true
allow: '*'
-------------------------
# vulcan.yaml (project config)
extensions:
postgres: '@vulcan-sql/extension-driver-duckdb'
duckdb: '@vulcan-sql/extension-driver-duckdb'
profiles:
- ./pg-profile.yaml
- ./duck-profile.yaml
You should make sure you have installed the data source driver package and declared the module name under the extensions
of the project config.
Profile fields
In. this Profile, we should give these fields:
name
- Thename
is the data source name for recognizing so that API Schema could set the name to know where the data source the API request queries the result from. Like aboveduckdb-profile.yaml
example, the name isduck
, so you could set theduck
inprofiles
/profile
in the API Schema to specify what data source the query is from.type
- It's a data source type, each data source type uses themodule-name
under theextensions
config to be thetype
for recognizing, the above sample you could see.connection
- The needed information to make the connection built, you should check what the connection fields need in each external extension of the data, e.g: @vulcan-sql/extension-driver-pg npm.allow
- Theallow
field could make our Data API could query the data result from different data sources according to whether the user has permission or not. The API Schemaprofiles
/profile
fields have shown some examples. For theallow
configuration rule, you could see the Authorization for introducing detail.