Skip to content

sveltespot/libsql-python

 
 

Repository files navigation

PyLibSQL

This is a fork of the original libsql-experimental-python project.

Caution

This is a work in progress and is not yet ready for production use.

Installation

Note

This package is not yet available on PyPI and must be installed from source. Easiest way to install is to clone the repository, source the virtual environment and run maturin develop.

git clone https://github.com/sveltespot/pylibsql.git
cd pylibsql
python3 -m venv ~/.venv
source ~/.venv/bin/activate
pip install maturin
maturin develop

Usage

import pylibsql

con = pylibsql.connect("hello.db", sync_url="http://localhost:8080", auth_token="")

con.sync()

cur = con.cursor()

cur.execute("CREATE TABLE IF NOT EXISTS users (id INTEGER, email TEXT);")
cur.execute("INSERT INTO users VALUES (1, 'penberg@iki.fi')")

print(cur.execute("SELECT * FROM users").fetchone())

Development

Dependencies

  • Python 3.7+ with pip and venv (Install python-dev package for your distribution)
  • Rust toolchain
  • maturin (install with pip install maturin)

Building

maturin develop

About

libSQL API for Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 59.0%
  • Python 37.1%
  • Dockerfile 2.6%
  • Nix 1.3%