| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A LibSQL dialect for SQLAlchemy.
This dialect requires SQLAlchemy 2.0 or later.
This dialect requires SQLAlchemy and libsql_client. They are specified as requirements so pip will install them if they are not already in place. To install, just:
pip install sqlalchemy-libsql
Create an URL that points to your libsql database. Then, in your Python app, you can connect to the database via:
from sqlalchemy import create_engine
engine = create_engine("sqlite+libsql://your-db.your-server.com?authToken=JWT_HERE&secure=true")
Note that secure=true query/search parameter will force the usage of secure WebSockets (wss://) to connect to the remote server.
This project uses poetry, can be tested with pytest and should be checked with pre-commit. A pure-python test server is used as a submodule:
git clone https://github.com/libsql/sqlalchemy-libsql.git cd sqlalchemy-libsql git submodule init && git submodule update # hrana-test-server pre-commit install # install git-hooks poetry install --with dev # pytest pre-commit run -a # check all files in the project, runs pytest poetry run pytest poetry run pytest --log-debug=libsql_client # debug libsql_client usage # run against WSS server: poetry run pytest --dburi "sqlite+libsql://server.com?secure=true&authToken=JWT_HERE"
SQLAlchemy-libsql is part of the SQLAlchemy Project and adheres to the same standards and conventions as the core project.
Please refer to the SQLAlchemy Community Guide for guidelines on coding and participating in this project.
Above all, SQLAlchemy places great emphasis on polite, thoughtful, and constructive communication between users and developers. Please see our current Code of Conduct at Code of Conduct.
This project structure is based on https://github.com/gordthompson/sqlalchemy-access, a project cited at README.dialects.rst.
SQLAlchemy-libsql is distributed under the MIT license.
| Back | FazBrowse Home | New Git URL |