quillsql 2.1.6__tar.gz → 2.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- quillsql-2.2.1/PKG-INFO +69 -0
- quillsql-2.2.1/README.md +46 -0
- quillsql-2.2.1/quillsql/__init__.py +5 -0
- quillsql-2.2.1/quillsql/assets/__init__.py +3 -0
- quillsql-2.2.1/quillsql/assets/pgtypes.py +697 -0
- quillsql-2.2.1/quillsql/core.py +541 -0
- quillsql-2.2.1/quillsql/db/__init__.py +3 -0
- quillsql-2.2.1/quillsql/db/bigquery.py +148 -0
- {quillsql-2.1.6 → quillsql-2.2.1}/quillsql/db/cached_connection.py +6 -5
- {quillsql-2.1.6 → quillsql-2.2.1}/quillsql/db/db_helper.py +36 -17
- quillsql-2.2.1/quillsql/db/postgres.py +127 -0
- quillsql-2.2.1/quillsql/error.py +5 -0
- quillsql-2.2.1/quillsql/utils/__init__.py +4 -0
- quillsql-2.2.1/quillsql/utils/filters.py +180 -0
- quillsql-2.2.1/quillsql/utils/pivot_template.py +485 -0
- quillsql-2.2.1/quillsql/utils/run_query_processes.py +20 -0
- quillsql-2.2.1/quillsql/utils/schema_conversion.py +9 -0
- quillsql-2.2.1/quillsql/utils/tenants.py +60 -0
- quillsql-2.2.1/quillsql.egg-info/PKG-INFO +69 -0
- {quillsql-2.1.6 → quillsql-2.2.1}/quillsql.egg-info/SOURCES.txt +4 -1
- {quillsql-2.1.6 → quillsql-2.2.1}/setup.py +3 -3
- quillsql-2.1.6/PKG-INFO +0 -72
- quillsql-2.1.6/README.md +0 -56
- quillsql-2.1.6/quillsql/__init__.py +0 -4
- quillsql-2.1.6/quillsql/assets/__init__.py +0 -3
- quillsql-2.1.6/quillsql/assets/pgtypes.py +0 -2782
- quillsql-2.1.6/quillsql/core.py +0 -168
- quillsql-2.1.6/quillsql/db/__init__.py +0 -3
- quillsql-2.1.6/quillsql/db/bigquery.py +0 -114
- quillsql-2.1.6/quillsql/db/postgres.py +0 -72
- quillsql-2.1.6/quillsql/error.py +0 -5
- quillsql-2.1.6/quillsql/utils/__init__.py +0 -3
- quillsql-2.1.6/quillsql/utils/run_query_processes.py +0 -19
- quillsql-2.1.6/quillsql/utils/schema_conversion.py +0 -6
- quillsql-2.1.6/quillsql.egg-info/PKG-INFO +0 -72
- {quillsql-2.1.6 → quillsql-2.2.1}/quillsql.egg-info/dependency_links.txt +0 -0
- {quillsql-2.1.6 → quillsql-2.2.1}/quillsql.egg-info/requires.txt +0 -0
- {quillsql-2.1.6 → quillsql-2.2.1}/quillsql.egg-info/top_level.txt +0 -0
- {quillsql-2.1.6 → quillsql-2.2.1}/setup.cfg +0 -0
quillsql-2.2.1/PKG-INFO
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: quillsql
|
|
3
|
+
Version: 2.2.1
|
|
4
|
+
Summary: Quill SDK for Python.
|
|
5
|
+
Home-page: https://github.com/quill-sql/quill-python
|
|
6
|
+
Author: Quill
|
|
7
|
+
Author-email: shawn@quill.co
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Requires-Dist: psycopg2-binary
|
|
10
|
+
Requires-Dist: requests
|
|
11
|
+
Requires-Dist: redis
|
|
12
|
+
Requires-Dist: python-dotenv
|
|
13
|
+
Requires-Dist: pytest
|
|
14
|
+
Requires-Dist: google-cloud-bigquery
|
|
15
|
+
Requires-Dist: google-auth
|
|
16
|
+
Dynamic: author
|
|
17
|
+
Dynamic: author-email
|
|
18
|
+
Dynamic: description
|
|
19
|
+
Dynamic: description-content-type
|
|
20
|
+
Dynamic: home-page
|
|
21
|
+
Dynamic: requires-dist
|
|
22
|
+
Dynamic: summary
|
|
23
|
+
|
|
24
|
+
# Quill Python SDK
|
|
25
|
+
|
|
26
|
+
## Quickstart
|
|
27
|
+
|
|
28
|
+
First, install the quillsql package by running:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
$ pip install quillsql
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Then, add a `/quill` endpoint to your existing python server. For example, if
|
|
35
|
+
you were running a FASTAPI app, you would just add the endpoint like this:
|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
from quillsql import Quill
|
|
39
|
+
|
|
40
|
+
quill = Quill(
|
|
41
|
+
private_key=os.getenv("QULL_PRIVATE_KEY"),
|
|
42
|
+
database_connection_string=os.getenv("POSTGRES_READ"),
|
|
43
|
+
database_type="postgresql"
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
security = HTTPBearer()
|
|
47
|
+
|
|
48
|
+
async def authenticate_jwt(token: str = Depends(security)):
|
|
49
|
+
# Your JWT validation logic here
|
|
50
|
+
# Return user object or raise HTTPException
|
|
51
|
+
user = validate_jwt_token(token.credentials)
|
|
52
|
+
return user
|
|
53
|
+
|
|
54
|
+
@app.post("/quill")
|
|
55
|
+
async def quill_post(data: Request, user: dict = Depends(authenticate_jwt)):
|
|
56
|
+
# assuming user fetched via auth middleware has an userId
|
|
57
|
+
user_id = user["user_id"]
|
|
58
|
+
body = await data.json()
|
|
59
|
+
metadata = body.get("metadata")
|
|
60
|
+
|
|
61
|
+
result = quill.query(
|
|
62
|
+
tenants=[{"tenantField": "user_id", "tenantIds": [user_id]}],
|
|
63
|
+
metadata=metadata
|
|
64
|
+
)
|
|
65
|
+
return result
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Then you can run your app like normally. Pass in this route to our react library
|
|
69
|
+
on the frontend and you all set!
|
quillsql-2.2.1/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Quill Python SDK
|
|
2
|
+
|
|
3
|
+
## Quickstart
|
|
4
|
+
|
|
5
|
+
First, install the quillsql package by running:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
$ pip install quillsql
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Then, add a `/quill` endpoint to your existing python server. For example, if
|
|
12
|
+
you were running a FASTAPI app, you would just add the endpoint like this:
|
|
13
|
+
|
|
14
|
+
```python
|
|
15
|
+
from quillsql import Quill
|
|
16
|
+
|
|
17
|
+
quill = Quill(
|
|
18
|
+
private_key=os.getenv("QULL_PRIVATE_KEY"),
|
|
19
|
+
database_connection_string=os.getenv("POSTGRES_READ"),
|
|
20
|
+
database_type="postgresql"
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
security = HTTPBearer()
|
|
24
|
+
|
|
25
|
+
async def authenticate_jwt(token: str = Depends(security)):
|
|
26
|
+
# Your JWT validation logic here
|
|
27
|
+
# Return user object or raise HTTPException
|
|
28
|
+
user = validate_jwt_token(token.credentials)
|
|
29
|
+
return user
|
|
30
|
+
|
|
31
|
+
@app.post("/quill")
|
|
32
|
+
async def quill_post(data: Request, user: dict = Depends(authenticate_jwt)):
|
|
33
|
+
# assuming user fetched via auth middleware has an userId
|
|
34
|
+
user_id = user["user_id"]
|
|
35
|
+
body = await data.json()
|
|
36
|
+
metadata = body.get("metadata")
|
|
37
|
+
|
|
38
|
+
result = quill.query(
|
|
39
|
+
tenants=[{"tenantField": "user_id", "tenantIds": [user_id]}],
|
|
40
|
+
metadata=metadata
|
|
41
|
+
)
|
|
42
|
+
return result
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Then you can run your app like normally. Pass in this route to our react library
|
|
46
|
+
on the frontend and you all set!
|