Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add doc for attach relational database with schema name #320

Merged
merged 3 commits into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/content/docs/extensions/attach/rdbms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,15 @@ conn.execute("INSERT INTO person values ('Dan', 25);")
#### 2. Attach database

```sql
ATTACH [DB_PATH] AS [alias] (dbtype duckdb, skip_unsupported_table = OPTION)
ATTACH [DB_PATH] AS [alias] (dbtype duckdb, skip_unsupported_table = OPTION, schema = SCHEMA_NAME)
```

- `DB_PATH`: Path to the DuckDB database instance (can be a relative/absolute/https/s3 path)
- `alias`: Database alias to use in Kùzu - If not provided, the database name from DuckDB will be used.
When attaching multiple databases, it's recommended to use aliasing.
- `skip_unsupported_table`: Whether kuzu should throw an exception or skip when encountering a table with unsupported datatype.
- `skip_unsupported_table`: Whether Kùzu should throw an exception or skip when encountering a table with unsupported datatype.
Supported options are: TRUE/FALSE. Default is FALSE.
- `schema`: The name of the schema in duckdb to attach. Kùzu attaches to the `main` schema of duckdb by default.

The below example shows how the `university.db` DuckDB database can be attached to Kùzu using
the alias `uw`:
Expand Down Expand Up @@ -288,12 +289,12 @@ asyncio.run(main())
#### 2. Attach database

```sql
ATTACH [PG_CONNECTION_STRING] AS [alias] (dbtype postgres, skip_unsupported_table = OPTION)
ATTACH [PG_CONNECTION_STRING] AS [alias] (dbtype postgres, skip_unsupported_table = OPTION, schema = SCHEMA_NAME)
```

- `skip_unsupported_table`: Whether kuzu should throw an exception or skip when encountering a table with unsupported datatype.
- `skip_unsupported_table`: Whether Kùzu should throw an exception or skip when encountering a table with unsupported datatype.
Supported options are: TRUE or FALSE. Default is FALSE.

- `schema`: The name of the schema in Postgres to attach. Kùzu attaches to the `public` schema of postgres by default.

The below example shows how the `university` PostgreSQL database can be attached to Kùzu using
the alias `uw`:
Expand Down Expand Up @@ -478,7 +479,7 @@ ATTACH [DB_PATH] AS [alias] (dbtype sqlite, skip_unsupported_table = OPTION)
- `DB_PATH`: Path to the SQLite database instance (can be relative or absolute path)
- `alias`: Database alias to use in Kùzu - If not provided, the database name from DuckDB will be used.
When attaching multiple databases, it's recommended to use aliasing.
- `skip_unsupported_table`: Whether kuzu should throw an exception or skip when encountering a table with unsupported datatype. Supported options: `TRUE` or `FALSE`.
- `skip_unsupported_table`: Whether Kùzu should throw an exception or skip when encountering a table with unsupported datatype. Supported options: `TRUE` or `FALSE`.


The below example shows how the `university.db` SQLite database can be attached to Kùzu using
Expand Down
Loading