Metadata-Version: 2.4
Name: sqlalchemy_altibase7
Version: 0.0.5
Summary: Altibase for SQLAlchemy
Author-email: Hess Lee <hess.lee7@gmail.com>
License: MIT
Project-URL: Source Code, https://github.com/hesslee/sqlalchemy-altibase7
Keywords: SQLAlchemy Altibase
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Database :: Front-Ends
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
Requires-Dist: odbcinst
Requires-Dist: pyodbc
Requires-Dist: sqlalchemy>=1.3.24
Provides-Extra: lint
Requires-Dist: black; extra == "lint"
Requires-Dist: flake8; extra == "lint"
Requires-Dist: mypy; extra == "lint"
Requires-Dist: isort; extra == "lint"
Requires-Dist: pre-commit; extra == "lint"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov[all]; extra == "test"

# sqlalchemy-altibase7
- Altibase support for SQLAlchemy implemented as an external dialect.
- It is tested on Altibase v7.
- This source code is based on https://pypi.org/project/sqlalchemy-altibase .
- This package itself is uploaded on https://pypi.org/project/sqlalchemy-altibase7 .

# Changes from sqlalchemy-altibase
- It is mainly supplemented for langchain connectivity.
- sqlalchemy version upper limit requirement is removed.

## Prereqisite
- Download and install Altibase server and client from http://support.altibase.com/en/product
- Unixodbc setting for Linux
- ODBC DSN setting for Windows

### Unixodbc setting example for Linux
- install : sudo apt-get install unixodbc-dev
- example configuration :
```
$ cat /etc/odbc.ini 
[PYODBC]
Driver          = /home/hess/work/altidev4/altibase_home/lib/libaltibase_odbc-64bit-ul64.so
Database        = mydb
ServerType      = Altibase
Server          = 127.0.0.1
Port            = 21121
UserName        = SYS
Password        = MANAGER
FetchBuffersize = 64
ReadOnly        = no

$ cat /etc/odbcinst.ini 
[ODBC]
Trace=Yes
TraceFile=/tmp/odbc_trace.log
```

### ODBC DSN setting example for Windows
- Altibase Windows ODBC driver is registered during Altibase Windows client installation procedure.
- Add a ODBC DSN for Altibase.
- example configuration :
```
[Altibase Connection Config]
Windows DSN Name: PYODBC
host(name or IP): 192.168.1.210
Port(default 20300): 21121
User: SYS
Password: MANAGER
Database: mydb
NLS_USE: UTF-8
```

# sqlalchemy-altibase7 using langchain
- install : pip install sqlalchemy-altibase7
- reference : https://python.langchain.com/v0.1/docs/use_cases/sql/
- test preparation : Populate sample data into Altibase database using "test/Chinook_Altibase.sql" file in this repository.
- test programs
  - langchain_chain.py : using chain
    - reference : https://python.langchain.com/v0.1/docs/use_cases/sql/quickstart/#chain
  - langchain_agent.py : using sql agent
    - reference : https://python.langchain.com/v0.1/docs/use_cases/sql/agents/#agent


