cwida / duckpgq-extension

DuckDB extension that adds support for SQL/PGQ
https://duckpgq.notion.site/b8ac652667964f958bfada1c3e53f1bb?v=3b47a8d44bdf4e0c8b503bf23f1b76f2
MIT License
86 stars 7 forks source link

Parser extension doesn't work in python environment #100

Closed Dtenwolde closed 8 months ago

Dtenwolde commented 9 months ago

The DuckPGQ parser extension does not seem to trigger from a Python environment

On macOS

python -m virtualenv .venv
source .venv/bin/activate
make release_python GEN=ninja
import duckdb
print(duckdb.__version__)
conn = duckdb.connect()
conn.execute("CREATE TABLE foo(I bigint)
conn.execute("-CREATE PROPERTY GRAPH snb VERTEX TABLES (foo)")

Results in duckdb.duckdb.ParserException: Parser Error: syntax error at or near "-"

Dtenwolde commented 8 months ago

Need to load the extension explicitly.

make release_python
python
import duckdb
print(duckdb.__version__)
conn = duckdb.connect('', config={'allow_unsigned_extensions': 'true'})
conn.execute("load '~/git/duckpgq/build/debug/extension/duckpgq/duckpgq.duckdb_extension'")
conn.execute("CREATE TABLE foo(I bigint)")
conn.execute("-CREATE PROPERTY GRAPH snb VERTEX TABLES (foo)")