%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.aliyun.com/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
# firebolt-sqlalchemy
[![Unit tests](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/unit-tests.yml)
[![Code quality checks](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/code-check.yml/badge.svg)](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/code-check.yml)
[![Firebolt Security Scan](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/security-scan.yml/badge.svg)](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/security-scan.yml)
[![Integration tests](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/python-integration-tests.yml/badge.svg)](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/python-integration-tests.yml)
![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/ptiurin/64f31d124b7249319234d247ade4a7db/raw/firebolt-sqlalchemy-coverage.json)
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=
```
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
# firebolt-sqlalchemy
[![Unit tests](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/unit-tests.yml)
[![Code quality checks](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/code-check.yml/badge.svg)](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/code-check.yml)
[![Firebolt Security Scan](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/security-scan.yml/badge.svg)](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/security-scan.yml)
[![Integration tests](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/python-integration-tests.yml/badge.svg)](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/python-integration-tests.yml)
![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/ptiurin/64f31d124b7249319234d247ade4a7db/raw/firebolt-sqlalchemy-coverage.json)
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=
```
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
# firebolt-sqlalchemy
[![Unit tests](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/unit-tests.yml)
[![Code quality checks](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/code-check.yml/badge.svg)](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/code-check.yml)
[![Firebolt Security Scan](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/security-scan.yml/badge.svg)](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/security-scan.yml)
[![Integration tests](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/python-integration-tests.yml/badge.svg)](https://github.com/firebolt-db/firebolt-sqlalchemy/actions/workflows/python-integration-tests.yml)
![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/ptiurin/64f31d124b7249319234d247ade4a7db/raw/firebolt-sqlalchemy-coverage.json)
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=
```
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
* Fri Jun 09 2023 Python_Bot - 0.9.1-1
- Package Spec generated