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.
Profile Structure
The profile could define in two ways:
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.
Define profile in the project config
Or you could define the data source profile under profiles options of the project config :
# vulcan.yaml (project config)
extensions:
  duckdb: '@vulcan-sql/extension-driver-duckdb'
  postgres: '@vulcan-sql/extension-driver-duckdb'
profiles:
  - name: duck
    type: duckdb
    connection:
      persistent-path: ./test-data/moma.db
      log-queries: true
      log-parameters: true
    allow: '*'
  - name: pg
    type: postgres
    allow: '*'
    connection:
      host: example.com
      user: vulcan
      password: secret
      database: vulcan
      port: 5432
Profile fields
In. this Profile, we should give these fields:
name- Thenameis the data source name for recognizing so that Data API Schema could set the name to know where the data source the API request queries the result from. Like aboveduckdb-porfile.yamlexample, the name isduck, so you could set theduckinprofiles/profilein 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-nameunder theextensionsconfig to be thetypefor 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- Theallowfield could make our Data API could query the data result from different data sources according to whether the user has permission or not. The Data API Schemaprofiles/profilefields have shown some examples. For theallowconfiguration rule, you could see the Authorization for introducing detail.