Skip to main content
Version: 0.0.42

lhc datasources

Manage Lakehousecat semantic datasources. Datasources define the database connections that the AI uses to answer analytical questions.

Commands​

datasources list​

lhc datasources list [--type <type>]
FlagDescription
--typeFilter by datasource type, e.g. postgresql, mysql, clickhouse

datasources get <id>​

lhc datasources get <id>

datasources create​

lhc datasources create \
--name <name> \
--type <datasource-type> \
--connection-string <connection-string>
FlagRequiredDescription
--nameyesDatasource name
--typeyesDatasource type (e.g. postgresql, mysql, clickhouse)
--connection-stringyesFull connection URI for the database

For the full list of supported types, see Datasource Types.


datasources update <id>​

Update a datasource's name, connection string, or state:

# Rename
lhc datasources update <id> --name "New Name"

# Correct a wrong connection string
lhc datasources update <id> --connection-string "postgresql://user:pass@host:5432/db"

# Disable a datasource
lhc datasources update <id> --is-enabled=false

# Lock a datasource (prevents editing and deletion)
lhc datasources update <id> --is-locked=true

# Combine multiple flags
lhc datasources update <id> --is-enabled=true --is-locked=false
FlagDescription
--nameNew display name
--connection-stringNew connection URI for the datasource
--is-enabledEnable (true) or disable (false) the datasource — disabled datasources are unavailable for use
--is-lockedLock (true) or unlock (false) the datasource — locked datasources cannot be edited or deleted
--is-visibleControl datasource visibility

At least one flag must be provided. Flags accept =true or =false syntax (e.g. --is-locked=false).


datasources delete <id>​

lhc datasources delete <id>

datasources search <query>​

lhc datasources search "prod"

datasources statistics​

lhc datasources statistics

Returns aggregate statistics across all datasources.


datasources export <id>​

Export a datasource definition to a portable .lhc.json file:

# Print to stdout
lhc datasources export <id>

# Write to file
lhc datasources export <id> -f datasource.lhc.json
FlagDescription
-f, --output-fileWrite output to this file (default: stdout)

The export file can be imported into any Lakehousecat instance.


datasources import <file>​

Import a datasource from a .lhc.json export file:

lhc datasources import datasource.lhc.json [--name <override-name>]
FlagDescription
--nameOverride the datasource name from the export file

If a datasource with the same name already exists, the import is aborted with an HTTP 409 error. Use --name to import under a different name, or delete the existing datasource first.