sqlalchemy-libsql
=================
A `LibSQL <https://libsql.org/>`_ dialect for SQLAlchemy.
This dialect requires SQLAlchemy 2.0 or later.
Pre-requisites
--------------
- Running instance of https://github.com/libsql/sqld. You can easily get one at https://turso.tech/
- Alternatively a https://github.com/libsql/hrana-test-server, a pure-python implementation
Co-requisites
-------------
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
Getting Started
---------------
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.
Development
-----------
This project uses `poetry <https://python-poetry.org/>`_, can be tested with
`pytest <https://pytest.org/>`_ and should be checked with
`pre-commit <https://pre-commit.com/>`_. A
`pure-python <https://github.com/libsql/hrana-test-server>`_ 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"
The SQLAlchemy Project
======================
SQLAlchemy-libsql is part of the `SQLAlchemy Project <https://www.sqlalchemy.org>`_ and
adheres to the same standards and conventions as the core project.
Development / Bug reporting / Pull requests
-------------------------------------------
Please refer to the
`SQLAlchemy Community Guide <https://www.sqlalchemy.org/develop.html>`_ for
guidelines on coding and participating in this project.
Code of Conduct
_______________
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 <https://www.sqlalchemy.org/codeofconduct.html>`_.
Credits
=======
This project structure is based on
https://github.com/gordthompson/sqlalchemy-access, a project cited at
`README.dialects.rst
<https://github.com/sqlalchemy/sqlalchemy/blob/main/README.dialects.rst>`_.
License
=======
SQLAlchemy-libsql is distributed under the `MIT license
<https://opensource.org/licenses/MIT>`_.
Raw data
{
"_id": null,
"home_page": "https://github.com/libsql/sqlalchemy-libsql",
"name": "sqlalchemy-libsql",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7,<4.0",
"maintainer_email": "",
"keywords": "SQLAlchemy,LibSQL,SQLite,Database",
"author": "Douglas Montes",
"author_email": "dmontes@chiselstrike.com",
"download_url": "https://files.pythonhosted.org/packages/9e/4b/b698ff846ff0ef5bbdcdd8b76c74ff69c9e248395ae5168d1d87264aeb4d/sqlalchemy_libsql-0.1.0.tar.gz",
"platform": null,
"description": "sqlalchemy-libsql\n=================\n\nA `LibSQL <https://libsql.org/>`_ dialect for SQLAlchemy.\n\nThis dialect requires SQLAlchemy 2.0 or later.\n\n\nPre-requisites\n--------------\n\n- Running instance of https://github.com/libsql/sqld. You can easily get one at https://turso.tech/\n- Alternatively a https://github.com/libsql/hrana-test-server, a pure-python implementation\n\nCo-requisites\n-------------\n\nThis dialect requires SQLAlchemy and libsql_client. They are specified as requirements so ``pip``\nwill install them if they are not already in place. To install, just::\n\n pip install sqlalchemy-libsql\n\nGetting Started\n---------------\n\nCreate an URL that points to your libsql database.\nThen, in your Python app, you can connect to the database via::\n\n from sqlalchemy import create_engine\n engine = create_engine(\"sqlite+libsql://your-db.your-server.com?authToken=JWT_HERE&secure=true\")\n\nNote that ``secure=true`` query/search parameter will force the usage of\nsecure WebSockets (``wss://``) to connect to the remote server.\n\nDevelopment\n-----------\n\nThis project uses `poetry <https://python-poetry.org/>`_, can be tested with\n`pytest <https://pytest.org/>`_ and should be checked with\n`pre-commit <https://pre-commit.com/>`_. A\n`pure-python <https://github.com/libsql/hrana-test-server>`_ test server is used\nas a submodule::\n\n git clone https://github.com/libsql/sqlalchemy-libsql.git\n cd sqlalchemy-libsql\n git submodule init && git submodule update # hrana-test-server\n\n pre-commit install # install git-hooks\n poetry install --with dev # pytest\n\n pre-commit run -a # check all files in the project, runs pytest\n\n poetry run pytest\n poetry run pytest --log-debug=libsql_client # debug libsql_client usage\n # run against WSS server:\n poetry run pytest --dburi \"sqlite+libsql://server.com?secure=true&authToken=JWT_HERE\"\n\n\nThe SQLAlchemy Project\n======================\n\nSQLAlchemy-libsql is part of the `SQLAlchemy Project <https://www.sqlalchemy.org>`_ and\nadheres to the same standards and conventions as the core project.\n\nDevelopment / Bug reporting / Pull requests\n-------------------------------------------\n\nPlease refer to the\n`SQLAlchemy Community Guide <https://www.sqlalchemy.org/develop.html>`_ for\nguidelines on coding and participating in this project.\n\nCode of Conduct\n_______________\n\nAbove all, SQLAlchemy places great emphasis on polite, thoughtful, and\nconstructive communication between users and developers.\nPlease see our current Code of Conduct at\n`Code of Conduct <https://www.sqlalchemy.org/codeofconduct.html>`_.\n\n\nCredits\n=======\n\nThis project structure is based on\nhttps://github.com/gordthompson/sqlalchemy-access, a project cited at\n`README.dialects.rst\n<https://github.com/sqlalchemy/sqlalchemy/blob/main/README.dialects.rst>`_.\n\n\nLicense\n=======\n\nSQLAlchemy-libsql is distributed under the `MIT license\n<https://opensource.org/licenses/MIT>`_.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "LibSQL.org for SQLAlchemy",
"version": "0.1.0",
"project_urls": {
"Documentation": "https://libsql.org/sqlalchemy-libsql/",
"Homepage": "https://github.com/libsql/sqlalchemy-libsql",
"Repository": "https://github.com/libsql/sqlalchemy-libsql"
},
"split_keywords": [
"sqlalchemy",
"libsql",
"sqlite",
"database"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "08954476bb94c2da3dbc164f7174ccc7860aea28f1cb2302c5b895755f28ae36",
"md5": "83492d31d2dd1f9b9db08983f2c7b2c1",
"sha256": "a4d5cf4089cf3a229d5b1b20e9b8ca7ac8e2c0784a11c5ead3c66c5c9b18ae19"
},
"downloads": -1,
"filename": "sqlalchemy_libsql-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "83492d31d2dd1f9b9db08983f2c7b2c1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4.0",
"size": 6466,
"upload_time": "2023-05-25T16:26:03",
"upload_time_iso_8601": "2023-05-25T16:26:03.644143Z",
"url": "https://files.pythonhosted.org/packages/08/95/4476bb94c2da3dbc164f7174ccc7860aea28f1cb2302c5b895755f28ae36/sqlalchemy_libsql-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9e4bb698ff846ff0ef5bbdcdd8b76c74ff69c9e248395ae5168d1d87264aeb4d",
"md5": "76f613fa7a5f6086eb991f30dd5ebb56",
"sha256": "5b44506d0e59f5021b6b63b7b97496889cb3692cdd443c0fe5e2b63abcab589f"
},
"downloads": -1,
"filename": "sqlalchemy_libsql-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "76f613fa7a5f6086eb991f30dd5ebb56",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 5582,
"upload_time": "2023-05-25T16:26:05",
"upload_time_iso_8601": "2023-05-25T16:26:05.689010Z",
"url": "https://files.pythonhosted.org/packages/9e/4b/b698ff846ff0ef5bbdcdd8b76c74ff69c9e248395ae5168d1d87264aeb4d/sqlalchemy_libsql-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-25 16:26:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "libsql",
"github_project": "sqlalchemy-libsql",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "sqlalchemy-libsql"
}