Skip to content
This repository was archived by the owner on May 2, 2023. It is now read-only.

Commit b91b622

Browse files
committed
Copied initial code from data-diff at b23509d4dd439e3fb0af3949638bc2d050820b0a
1 parent 362de4a commit b91b622

33 files changed

Lines changed: 4799 additions & 0 deletions

.gitignore

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-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+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
target/
76+
77+
# Jupyter Notebook
78+
.ipynb_checkpoints
79+
80+
# IPython
81+
profile_default/
82+
ipython_config.py
83+
84+
# pyenv
85+
.python-version
86+
87+
# pipenv
88+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91+
# install all needed dependencies.
92+
#Pipfile.lock
93+
94+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
95+
__pypackages__/
96+
97+
# Celery stuff
98+
celerybeat-schedule
99+
celerybeat.pid
100+
101+
# SageMath parsed files
102+
*.sage.py
103+
104+
# Environments
105+
.env
106+
.venv
107+
env/
108+
venv/
109+
ENV/
110+
env.bak/
111+
venv.bak/
112+
113+
# Spyder project settings
114+
.spyderproject
115+
.spyproject
116+
117+
# Rope project settings
118+
.ropeproject
119+
120+
# mkdocs documentation
121+
/site
122+
123+
# mypy
124+
.mypy_cache/
125+
.dmypy.json
126+
dmypy.json
127+
128+
# Pyre type checker
129+
.pyre/
130+
131+
# Mac
132+
.DS_Store
133+
134+
# IntelliJ
135+
.idea
136+
137+
# VSCode
138+
.vscode

pyproject.toml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
[tool.poetry]
2+
name = "sqeleton"
3+
version = "0.0.1"
4+
description = "Python library for querying SQL databases"
5+
authors = ["Erez Shinan <erezshin@gmail.com>"]
6+
license = "MIT"
7+
readme = "README.md"
8+
repository = "https://github.com/datafold/sqeleton"
9+
documentation = ""
10+
classifiers = [
11+
"Intended Audience :: Developers",
12+
"Intended Audience :: Information Technology",
13+
"Intended Audience :: System Administrators",
14+
"Programming Language :: Python :: 3.7",
15+
"Programming Language :: Python :: 3.8",
16+
"Programming Language :: Python :: 3.9",
17+
"Programming Language :: Python :: 3.10",
18+
"Development Status :: 2 - Pre-Alpha",
19+
"Environment :: Console",
20+
"Topic :: Database :: Database Engines/Servers",
21+
"Typing :: Typed"
22+
]
23+
packages = [{ include = "sqeleton" }]
24+
25+
[tool.poetry.dependencies]
26+
python = "^3.7"
27+
runtype = "^0.2.6"
28+
dsnparse = "*"
29+
click = "^8.1"
30+
rich = "*"
31+
toml = "^0.10.2"
32+
mysql-connector-python = {version="8.0.29", optional=true}
33+
psycopg2 = {version="*", optional=true}
34+
snowflake-connector-python = {version="^2.7.2", optional=true}
35+
cryptography = {version="*", optional=true}
36+
trino = {version="^0.314.0", optional=true}
37+
presto-python-client = {version="*", optional=true}
38+
clickhouse-driver = {version="*", optional=true}
39+
duckdb = {version="^0.6.0", optional=true}
40+
41+
[tool.poetry.dev-dependencies]
42+
parameterized = "*"
43+
unittest-parallel = "*"
44+
duckdb = "^0.6.0"
45+
46+
[tool.poetry.extras]
47+
mysql = ["mysql-connector-python"]
48+
postgresql = ["psycopg2"]
49+
snowflake = ["snowflake-connector-python", "cryptography"]
50+
presto = ["presto-python-client"]
51+
oracle = ["cx_Oracle"]
52+
# databricks = ["databricks-sql-connector"]
53+
trino = ["trino"]
54+
clickhouse = ["clickhouse-driver"]
55+
vertica = ["vertica-python"]
56+
duckdb = ["duckdb"]
57+
58+
[build-system]
59+
requires = ["poetry-core>=1.0.0"]
60+
build-backend = "poetry.core.masonry.api"
61+
62+
[tool.poetry.scripts]
63+
sqeleton = 'sqeleton.__main__:main'

sqeleton/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .databases import connect

sqeleton/abcs/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from .database_types import (
2+
AbstractDatabase,
3+
AbstractDialect,
4+
DbKey,
5+
DbPath,
6+
DbTime,
7+
IKey,
8+
ColType_UUID,
9+
NumericType,
10+
PrecisionType,
11+
StringType,
12+
)
13+
from .compiler import AbstractCompiler, Compilable

sqeleton/abcs/compiler.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from typing import Any, Dict
2+
from abc import ABC, abstractmethod
3+
4+
5+
class AbstractCompiler(ABC):
6+
@abstractmethod
7+
def compile(self, elem: Any, params: Dict[str, Any] = None) -> str:
8+
...
9+
10+
11+
class Compilable(ABC):
12+
@abstractmethod
13+
def compile(self, c: AbstractCompiler) -> str:
14+
...

0 commit comments

Comments
 (0)