Skip to main content

DuckDB cursor wrapper

Project description

DuckDB-Cursor

DuckDB-Cursor is simple DuckDB wrapper.

Install

First install library,

pip install duckdb-cursor

Usage

Create an DB object and initialise it with the application,

from duckdb import connect
from duckdb_cursor import CURSOR

cur = CURSOR(connect("db.duckdb"))
cur.set("INSERT INTO users VALUES(1, ?);", ('Wendys', ))
del cur

can select one row,

cur = CURSOR(connect("db.duckdb"))
row = cur.get("SELECT name FROM users WHERE id=1;", as_dict=True, one=True)
del cur

print(row['name'])

can select all rows,

cur = CURSOR(connect("db.duckdb"))
rows = cur.get("SELECT name FROM users;")
del cur

print(rows)

Contributing

DuckDB-Cursor is developed on GitLab. You are very welcome to open issues or propose merge requests.

Help

This README is the best place to start, after that try opening an issue.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

duckdb-cursor-0.1.tar.gz (14.8 kB view hashes)

Uploaded Source

Built Distribution

duckdb_cursor-0.1-py3-none-any.whl (15.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page