diff options
author | CoprDistGit <infra@openeuler.org> | 2023-05-31 07:10:10 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-05-31 07:10:10 +0000 |
commit | d451123e22ed83bafb1452b0c6d5e4391c24d2c6 (patch) | |
tree | 3e6ca58775aad6e9b481ac8dff2c0ae463b7df67 | |
parent | eed1da3c3308c0549df43da04aa36100138c578a (diff) |
automatic import of python-firebolt-sqlalchemy
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-firebolt-sqlalchemy.spec | 428 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 430 insertions, 0 deletions
@@ -0,0 +1 @@ +/firebolt_sqlalchemy-0.9.1.tar.gz diff --git a/python-firebolt-sqlalchemy.spec b/python-firebolt-sqlalchemy.spec new file mode 100644 index 0000000..1a6bd40 --- /dev/null +++ b/python-firebolt-sqlalchemy.spec @@ -0,0 +1,428 @@ +%global _empty_manifest_terminate_build 0 +Name: python-firebolt-sqlalchemy +Version: 0.9.1 +Release: 1 +Summary: Sqlalchemy adapter for Firebolt +License: Apache-2.0 +URL: https://github.com/firebolt-db/firebolt-sqlalchemy +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/59/45/14d38740995c31aa780da4f8ceec502ec29e4401099ede0f6fe2b2455ac2/firebolt_sqlalchemy-0.9.1.tar.gz +BuildArch: noarch + +Requires: python3-firebolt-sdk +Requires: python3-sqlalchemy +Requires: python3-devtools +Requires: python3-greenlet +Requires: python3-mock +Requires: python3-mypy +Requires: python3-pre-commit +Requires: python3-pytest +Requires: python3-pytest-asyncio +Requires: python3-pytest-cov +Requires: python3-sqlalchemy-stubs + +%description +<p align="center"> + <img width="761" alt="SQLAlchemy and Firebolt" src="https://user-images.githubusercontent.com/7674553/145249436-534b3cc0-2350-4f7e-9c56-78ffbcc0f003.png"> +</p> + +# firebolt-sqlalchemy + +[](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/unit-tests.yml) +[](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/code-check.yml) +[](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/security-scan.yml) +[](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/python-integration-tests.yml) + + + + +The [Firebolt](https://www.firebolt.io/) dialect for [SQLAlchemy](https://www.sqlalchemy.org/). `firebolt-sqlalchemy` uses [Firebolt's Python SDK](https://github.com/firebolt-db/firebolt-python-sdk) which implements [PEP 249](https://www.python.org/dev/peps/pep-0249/). + +* [SQLAlchemy Dialects](https://docs.sqlalchemy.org/en/14/dialects/index.html) +* [PyPI Package](https://pypi.org/project/firebolt-sqlalchemy/) + +## Installation + +Requires Python >=3.7. + +```bash +pip install firebolt-sqlalchemy +``` + +## Connecting + +Connection strings use the following structure: + +``` +firebolt://{username}:{password}@{database}[/{engine_name}][?account_name={name}}] +``` + +`engine_name` is optional. If omitted, Firebolt will use the default engine for the database. + +`account_name` is optional. If omitted a default account will be used for connection. + +Examples: + +``` +firebolt://email@domain:password@sample_database +firebolt://email@domain:password@sample_database/sample_engine +``` + +If a different account name is required, it can be specified in the connection string + +``` +firebolt://email@domain:password@sample_database/sample_engine?account_name=my_account +``` + +To override the API URL (e.g. for dev testing): + +```bash +export FIREBOLT_BASE_URL=<your_url> +``` + +If your password contains % or / characters they need to be sanitised as per https://docs.sqlalchemy.org/en/14/core/engines.html#database-urls +```python +my_pass = "0920%/2" +import urllib.parse +new_pass = urllib.parse.quote_plus(my_pass) +``` + +## Quick Start + +```python +import urllib.parse +from sqlalchemy import create_engine + +password = urllib.parse.quote_plus("your_password_here") +engine = create_engine("firebolt://email@domain:" + password + "@sample_database/sample_engine") +connection = engine.connect() + +connection.execute("CREATE FACT TABLE example(dummy int) PRIMARY INDEX dummy") +connection.execute("INSERT INTO example(dummy) VALUES (11)") +result = connection.execute("SELECT * FROM example") +for item in result.fetchall(): + print(item) +``` + +### [AsyncIO](https://docs.sqlalchemy.org/en/14/orm/extensions/asyncio.html) extension + +```python +import urllib.parse +from sqlalchemy import text +from sqlalchemy.ext.asyncio import create_async_engine + +password = urllib.parse.quote_plus("your_password_here") +engine = create_async_engine("asyncio+firebolt://email@domain:" + password + "@sample_database/sample_engine") + +async with engine.connect() as conn: + + await conn.execute( + text(f"INSERT INTO example(dummy) VALUES (11)") + ) + + result = await conn.execute( + text(f"SELECT * FROM example") + ) + print(result.fetchall()) + +await engine.dispose() +``` + + +## Limitations + +1. Transactions are not supported since Firebolt database does not support them at this time. +1. Parametrised calls to execute and executemany are not implemented. + +## Contributing + +See: [CONTRIBUTING.MD](https://github.com/firebolt-db/firebolt-sqlalchemy/tree/master/CONTRIBUTING.MD) + + +%package -n python3-firebolt-sqlalchemy +Summary: Sqlalchemy adapter for Firebolt +Provides: python-firebolt-sqlalchemy +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-firebolt-sqlalchemy +<p align="center"> + <img width="761" alt="SQLAlchemy and Firebolt" src="https://user-images.githubusercontent.com/7674553/145249436-534b3cc0-2350-4f7e-9c56-78ffbcc0f003.png"> +</p> + +# firebolt-sqlalchemy + +[](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/unit-tests.yml) +[](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/code-check.yml) +[](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/security-scan.yml) +[](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/python-integration-tests.yml) + + + + +The [Firebolt](https://www.firebolt.io/) dialect for [SQLAlchemy](https://www.sqlalchemy.org/). `firebolt-sqlalchemy` uses [Firebolt's Python SDK](https://github.com/firebolt-db/firebolt-python-sdk) which implements [PEP 249](https://www.python.org/dev/peps/pep-0249/). + +* [SQLAlchemy Dialects](https://docs.sqlalchemy.org/en/14/dialects/index.html) +* [PyPI Package](https://pypi.org/project/firebolt-sqlalchemy/) + +## Installation + +Requires Python >=3.7. + +```bash +pip install firebolt-sqlalchemy +``` + +## Connecting + +Connection strings use the following structure: + +``` +firebolt://{username}:{password}@{database}[/{engine_name}][?account_name={name}}] +``` + +`engine_name` is optional. If omitted, Firebolt will use the default engine for the database. + +`account_name` is optional. If omitted a default account will be used for connection. + +Examples: + +``` +firebolt://email@domain:password@sample_database +firebolt://email@domain:password@sample_database/sample_engine +``` + +If a different account name is required, it can be specified in the connection string + +``` +firebolt://email@domain:password@sample_database/sample_engine?account_name=my_account +``` + +To override the API URL (e.g. for dev testing): + +```bash +export FIREBOLT_BASE_URL=<your_url> +``` + +If your password contains % or / characters they need to be sanitised as per https://docs.sqlalchemy.org/en/14/core/engines.html#database-urls +```python +my_pass = "0920%/2" +import urllib.parse +new_pass = urllib.parse.quote_plus(my_pass) +``` + +## Quick Start + +```python +import urllib.parse +from sqlalchemy import create_engine + +password = urllib.parse.quote_plus("your_password_here") +engine = create_engine("firebolt://email@domain:" + password + "@sample_database/sample_engine") +connection = engine.connect() + +connection.execute("CREATE FACT TABLE example(dummy int) PRIMARY INDEX dummy") +connection.execute("INSERT INTO example(dummy) VALUES (11)") +result = connection.execute("SELECT * FROM example") +for item in result.fetchall(): + print(item) +``` + +### [AsyncIO](https://docs.sqlalchemy.org/en/14/orm/extensions/asyncio.html) extension + +```python +import urllib.parse +from sqlalchemy import text +from sqlalchemy.ext.asyncio import create_async_engine + +password = urllib.parse.quote_plus("your_password_here") +engine = create_async_engine("asyncio+firebolt://email@domain:" + password + "@sample_database/sample_engine") + +async with engine.connect() as conn: + + await conn.execute( + text(f"INSERT INTO example(dummy) VALUES (11)") + ) + + result = await conn.execute( + text(f"SELECT * FROM example") + ) + print(result.fetchall()) + +await engine.dispose() +``` + + +## Limitations + +1. Transactions are not supported since Firebolt database does not support them at this time. +1. Parametrised calls to execute and executemany are not implemented. + +## Contributing + +See: [CONTRIBUTING.MD](https://github.com/firebolt-db/firebolt-sqlalchemy/tree/master/CONTRIBUTING.MD) + + +%package help +Summary: Development documents and examples for firebolt-sqlalchemy +Provides: python3-firebolt-sqlalchemy-doc +%description help +<p align="center"> + <img width="761" alt="SQLAlchemy and Firebolt" src="https://user-images.githubusercontent.com/7674553/145249436-534b3cc0-2350-4f7e-9c56-78ffbcc0f003.png"> +</p> + +# firebolt-sqlalchemy + +[](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/unit-tests.yml) +[](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/code-check.yml) +[](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/security-scan.yml) +[](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/python-integration-tests.yml) + + + + +The [Firebolt](https://www.firebolt.io/) dialect for [SQLAlchemy](https://www.sqlalchemy.org/). `firebolt-sqlalchemy` uses [Firebolt's Python SDK](https://github.com/firebolt-db/firebolt-python-sdk) which implements [PEP 249](https://www.python.org/dev/peps/pep-0249/). + +* [SQLAlchemy Dialects](https://docs.sqlalchemy.org/en/14/dialects/index.html) +* [PyPI Package](https://pypi.org/project/firebolt-sqlalchemy/) + +## Installation + +Requires Python >=3.7. + +```bash +pip install firebolt-sqlalchemy +``` + +## Connecting + +Connection strings use the following structure: + +``` +firebolt://{username}:{password}@{database}[/{engine_name}][?account_name={name}}] +``` + +`engine_name` is optional. If omitted, Firebolt will use the default engine for the database. + +`account_name` is optional. If omitted a default account will be used for connection. + +Examples: + +``` +firebolt://email@domain:password@sample_database +firebolt://email@domain:password@sample_database/sample_engine +``` + +If a different account name is required, it can be specified in the connection string + +``` +firebolt://email@domain:password@sample_database/sample_engine?account_name=my_account +``` + +To override the API URL (e.g. for dev testing): + +```bash +export FIREBOLT_BASE_URL=<your_url> +``` + +If your password contains % or / characters they need to be sanitised as per https://docs.sqlalchemy.org/en/14/core/engines.html#database-urls +```python +my_pass = "0920%/2" +import urllib.parse +new_pass = urllib.parse.quote_plus(my_pass) +``` + +## Quick Start + +```python +import urllib.parse +from sqlalchemy import create_engine + +password = urllib.parse.quote_plus("your_password_here") +engine = create_engine("firebolt://email@domain:" + password + "@sample_database/sample_engine") +connection = engine.connect() + +connection.execute("CREATE FACT TABLE example(dummy int) PRIMARY INDEX dummy") +connection.execute("INSERT INTO example(dummy) VALUES (11)") +result = connection.execute("SELECT * FROM example") +for item in result.fetchall(): + print(item) +``` + +### [AsyncIO](https://docs.sqlalchemy.org/en/14/orm/extensions/asyncio.html) extension + +```python +import urllib.parse +from sqlalchemy import text +from sqlalchemy.ext.asyncio import create_async_engine + +password = urllib.parse.quote_plus("your_password_here") +engine = create_async_engine("asyncio+firebolt://email@domain:" + password + "@sample_database/sample_engine") + +async with engine.connect() as conn: + + await conn.execute( + text(f"INSERT INTO example(dummy) VALUES (11)") + ) + + result = await conn.execute( + text(f"SELECT * FROM example") + ) + print(result.fetchall()) + +await engine.dispose() +``` + + +## Limitations + +1. Transactions are not supported since Firebolt database does not support them at this time. +1. Parametrised calls to execute and executemany are not implemented. + +## Contributing + +See: [CONTRIBUTING.MD](https://github.com/firebolt-db/firebolt-sqlalchemy/tree/master/CONTRIBUTING.MD) + + +%prep +%autosetup -n firebolt-sqlalchemy-0.9.1 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-firebolt-sqlalchemy -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 31 2023 Python_Bot <Python_Bot@openeuler.org> - 0.9.1-1 +- Package Spec generated @@ -0,0 +1 @@ +36cf14ff28ba614c23f9be6361e01b1e firebolt_sqlalchemy-0.9.1.tar.gz |