Connecting to DuckDB
Prerequisites
- PuppyGraph can connect to a persistent DuckDB database file. In memory database is not supported.
- Note that DuckDB does not support reading from and writing to by different processes. Therefore, no change can be made to the DuckDB database by another process when PuppyGraph connects to it. See this page to learn more about DuckDB's concurrency handling.
Configuration
| Configuration | Explanation |
|---|---|
| JDBC URI | A JDBC compatible connection URI of the data source. Read this page for more details on how to construct the URI. |
| JDBC Driver Class | The class name of the JDBC Driver. The default value is |
| JDBC Driver URL | The URL of the DuckDB JDBC Driver. Please choose the version of the driver that is compatible with your DuckDB database. By default, PuppyGraph uses DuckDB 1.0.0 |
Data Type Mapping
| DuckDB Type | PuppyGraph Type | Description |
|---|---|---|
BOOLEAN |
Boolean |
True or false |
SMALLINT |
Short |
16-bit signed integer |
UTINYINT |
Short |
8-bit unsigned integer, widened |
INTEGER |
Int |
32-bit signed integer |
USMALLINT |
Int |
16-bit unsigned integer, widened |
BIGINT |
Long |
64-bit signed integer |
UINTEGER |
Long |
32-bit unsigned integer, widened |
UBIGINT |
HugeInt |
64-bit unsigned integer, widened |
HUGEINT |
HugeInt |
128-bit signed integer |
FLOAT |
Float |
32-bit IEEE 754 floating point |
DOUBLE |
Double |
64-bit IEEE 754 floating point |
DECIMAL(P, S) |
Decimal(P, S) |
Fixed-point decimal; precision P, scale S |
VARCHAR |
String |
Character strings |
JSON |
String |
JSON document as text |
DATE |
Date |
Calendar date without time or timezone |
TIMESTAMP |
DateTime |
Date and time with microsecond precision |
T[] |
Array<E> |
List of values. Supported element types are BOOLEAN, the integer types (including TINYINT, which maps to Byte), FLOAT, DOUBLE, DECIMAL, DATE, TIMESTAMP, TIMESTAMPTZ, VARCHAR and JSON |
- A scalar
TINYINTcolumn is not supported, althoughTINYINT[]is. - Columns of any other type, such as
TIME,TIMESTAMPTZ,BLOB,UUID,INTERVAL,STRUCT,MAPorENUM, are not supported. They are listed in Schema Builder, but you cannot add them to a node or edge as attributes.
If you need a data type that is not supported, or one that is not listed here, contact us.
Demo
See Querying DuckDB Data as a Graph for a complete demo for DuckDB. The demo includes setting up the connection to a DuckDB database file.