Skip to content

Commit e1b1b78

Browse files
committed
initial commit
0 parents  commit e1b1b78

File tree

17 files changed

+2547
-0
lines changed

17 files changed

+2547
-0
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 4
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = false
12+
insert_final_newline = false

.gitignore

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
/demo
2+
/*settings.py
3+
# /.vscode
4+
/.idea
5+
6+
# Byte-compiled / optimized / DLL files
7+
__pycache__/
8+
*.py[cod]
9+
*$py.class
10+
11+
# Distribution / packaging
12+
.Python
13+
build/
14+
develop-eggs/
15+
dist/
16+
downloads/
17+
eggs/
18+
.eggs/
19+
lib/
20+
lib64/
21+
parts/
22+
sdist/
23+
var/
24+
wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
.hypothesis/
50+
.pytest_cache/
51+
52+
# Translations
53+
*.mo
54+
*.pot
55+
56+
# Django stuff:
57+
*.log
58+
local_settings.py
59+
db.sqlite3
60+
61+
# Flask stuff:
62+
instance/
63+
.webassets-cache
64+
65+
# Scrapy stuff:
66+
.scrapy
67+
68+
# Sphinx documentation
69+
docs/_build/
70+
71+
# PyBuilder
72+
target/
73+
74+
# Jupyter Notebook
75+
.ipynb_checkpoints
76+
77+
# pyenv
78+
.python-version
79+
80+
# celery beat schedule file
81+
celerybeat-schedule
82+
83+
# SageMath parsed files
84+
*.sage.py
85+
86+
# Environments
87+
.env
88+
.venv
89+
env/
90+
venv/
91+
ENV/
92+
env.bak/
93+
venv.bak/
94+
95+
# Spyder project settings
96+
.spyderproject
97+
.spyproject
98+
99+
# Rope project settings
100+
.ropeproject
101+
102+
# mkdocs documentation
103+
/site
104+
105+
# mypy
106+
.mypy_cache/
107+
108+
*.mac

.vscode/launch.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Python: Module",
9+
"type": "python",
10+
"request": "launch",
11+
"module": "pytest",
12+
"justMyCode": false
13+
}
14+
]
15+
}

.vscode/settings.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"python.testing.pytestArgs": [],
3+
"python.testing.unittestEnabled": false,
4+
"python.testing.pytestEnabled": true,
5+
"python.linting.flake8Enabled": true,
6+
"python.linting.flake8Args": [
7+
"--max-line-length=120"
8+
],
9+
"python.linting.enabled": true
10+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Dmitry Maslennikov
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
sqlalchemy-iris
2+
===
3+
4+
An InterSystems IRIS dialect for SQLAlchemy.
5+
6+
Pre-requisites
7+
---
8+
9+
This dialect requires SQLAlchemy, InterSystems DB-API driver. They are specified as requirements so ``pip``
10+
will install them if they are not already in place. To install, just:
11+
12+
pip install sqlalchemy-iris
13+
14+
Usage
15+
---
16+
17+
In your Python app, you can connect to the database via:
18+
19+
from sqlalchemy import create_engine
20+
engine = create_engine("iris://_SYSTEM:SYS@localhost:1972/USER")

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SQLAlchemy>=1.4

setup.cfg

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[metadata]
2+
name = sqlalchemy-iris
3+
version = 0.1.0
4+
description = InterSystems IRIS for SQLAlchemy
5+
long_description = file: README.md
6+
url = https://github.com/caretdev/sqlalchemy-iris
7+
maintainer = CaretDev
8+
maintainer_email = [email protected]
9+
license = MIT
10+
long_description_content_type = text/markdown
11+
classifiers =
12+
Development Status :: 4 - Beta
13+
Intended Audience :: Developers
14+
License :: OSI Approved :: MIT License
15+
Programming Language :: Python
16+
Programming Language :: Python :: 3
17+
Programming Language :: Python :: 3.9
18+
Programming Language :: Python :: 3.10
19+
Topic :: Database :: Front-Ends
20+
Operating System :: OS Independent
21+
keywords="SQLAlchemy InterSystems IRIS",
22+
project_urls =
23+
Source = https://github.com/caretdev/sqlalchemy-iris
24+
Tracker = https://github.com/caretdev/sqlalchemy-iris/issues
25+
26+
[options]
27+
packages =
28+
sqlalchemy_iris
29+
python_requires = >=3.9
30+
31+
dependency_links =
32+
https://github.com/intersystems-community/iris-driver-distribution/raw/main/DB-API/intersystems_irispython-3.2.0-py3-none-any.whl#egg=intersystems-irispython-3.2.0
33+
34+
[tool:pytest]
35+
addopts= --tb native -v -r fxX --maxfail=25 -p no:warnings
36+
python_files=test/*test_*.py
37+
38+
[db]
39+
default=iris+iris://_SYSTEM:SYS@localhost:1972/USER
40+
sqlite=sqlite:///:memory:
41+
42+
[sqla_testing]
43+
requirement_cls=sqlalchemy_iris.requirements:Requirements
44+
profile_file=test/profiles.txt

setup.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from setuptools import setup
2+
import os
3+
4+
thelibFolder = os.path.dirname(os.path.realpath(__file__))
5+
requirementPath = thelibFolder + '/requirements.txt'
6+
7+
requirements, dependency_links = [], []
8+
if os.path.isfile(requirementPath):
9+
with open('./requirements.txt') as f:
10+
for line in f.read().splitlines():
11+
if line.startswith('http'):
12+
dependency_links.append(line)
13+
else:
14+
requirements.append(line)
15+
16+
setup(
17+
install_requires=requirements,
18+
dependency_links=dependency_links,
19+
entry_points={
20+
"sqlalchemy.dialects": [
21+
"iris = sqlalchemy_iris:IRISDialect",
22+
]
23+
},
24+
)

sqlalchemy_iris/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from . import base
2+
from . import iris
3+
from .base import IRISDialect
4+
from .iris import IRISDialect_iris
5+
6+
base.dialect = dialect = iris.dialect
7+
8+
__all__ = [
9+
IRISDialect,
10+
IRISDialect_iris,
11+
dialect,
12+
]

0 commit comments

Comments
 (0)