Skip to content

Commit e8697bf

Browse files
committed
v0.3.0post1
- Typing fix for \_\_getattr\_\_ - README upd - Docs fix - Time tests fix
1 parent 16f01f1 commit e8697bf

File tree

8 files changed

+27
-14
lines changed

8 files changed

+27
-14
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ The most pythonic ORM. Seriously, try it out!<br>
2626
pip install sqllex
2727
```
2828

29-
| Version | Status | Tests, and actions |
30-
|:------------:|:----------------------------------------------------------------:|:---------------------------------------------------------------------------------------------------------------------:|
31-
| `==0.2.3` | ✔️ supported <br> ✔️ stable | [![code-ql-img]][code-ql-src] <br> [![sqllex-tests-img]][sqllex-tests-src] <br> [![pypi-upload-img]][pypi-upload-img] |
32-
| `<=0.2.0.4` | ⚠️ outdated <br> ⚠️ Security issue <br> CVE-2022-0329 | ⚠️ Mostly passing |
33-
| `<=0.1.10.4` | ❌️ outdated | |
29+
| Version | Status | Tests, and actions |
30+
|:------------:|:-------------------------------------:|:---------------------------------------------------------------------------------------------------------------------:|
31+
| `==0.3.0` | ✔️ supported <br> ✔️ stable | [![code-ql-img]][code-ql-src] <br> [![sqllex-tests-img]][sqllex-tests-src] <br> [![pypi-upload-img]][pypi-upload-img] |
32+
| `<=0.2.3` | ⚠️ outdated | ⚠️ Mostly passing |
33+
| `<=0.2.0.4` | ❌️ Security issue <br> CVE-2022-0329 | ❌️ |
3434

3535

3636
| Databases | Support |
37-
| :--- | :-----: |
38-
| SQLite | ✔️|
39-
| PostgreSQL | ✔️*|
37+
|:-----------|:-------:|
38+
| SQLite | ✔️ |
39+
| PostgreSQL | ✔️* |
4040

4141
<small>* - partially support</small>
4242

docs/about-column.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class AbstractColumn:
4141

4242
```python
4343
import sqllex as sx
44-
from sqllex.classes import
4544

4645
db = sx.SQLite3x(path='db-1.db')
4746
# db = sx.PostgreSQL(...)
@@ -54,8 +53,8 @@ db.create_table(
5453
}
5554
)
5655

57-
id_col: AbstractColumn = db['users']['id'] # AbstractColumn
58-
name_col: AbstractColumn = db['users']['name'] # AbstractColumn
56+
id_col: sx.SQLite3xColumn = db['users']['id'] # AbstractColumn
57+
name_col: sx.SQLite3xColumn = db['users']['name'] # AbstractColumn
5958

6059
db.update(
6160
TABLE='users', # table name

docs/about-postgresqlx.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ db = sx.PostgreSQLx(
3030
)
3131
```
3232

33+
> engine : {PostgreSQLxEngine | ModuleType}
34+
>
35+
> Engine for postgres interaction (psycopg2 for example)
36+
3337
PostgreSQL now is only partially support.
3438
It has the same api interface as SQLite3x so feel free to use documentation
3539
of it for PostgreSQLx. Just replace `SQLite3x` at `PostgreSQLx`.

docs/about-table.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ db.create_table(
4545
}
4646
)
4747

48-
users: sx.SQLite3xTable = db['users'] # <--- HERE WE GOT AbstractTable
48+
users: sx.SQLite3xTable = db['users'] # <--- HERE WE GOT
4949
# users: PostgreSQLxTable = db['users']
5050

5151
users.insert([1, 'Alex', 1])

sqllex/core/entities/postgresqlx/postgresqlx.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ def __init__(
101101
102102
Parameters
103103
----------
104+
engine : PostgreSQLxEngine | ModuleType
105+
Engine for postgres interaction (psycopg2 for example)
104106
dbname : AnyStr
105107
Name of database to connect, "postgres" by default
106108
user: AnyStr
@@ -169,6 +171,10 @@ def __bool__(self):
169171
logger.error(error)
170172
return False
171173

174+
@copy_docs(ABDatabase.__getitem__)
175+
def __getitem__(self, key) -> PostgreSQLxTable:
176+
return super(PostgreSQLx, self).__getitem__(key)
177+
172178
# =============================== PROPERTIES ==================================
173179

174180
@property

sqllex/core/entities/sqlite3x/sqlite3x.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ def __bool__(self):
159159
logger.error(error)
160160
return False
161161

162+
@copy_docs(ABDatabase.__getitem__)
163+
def __getitem__(self, key) -> SQLite3xTable:
164+
return super(SQLite3x, self).__getitem__(key)
165+
162166
# =============================== PROPERTIES ==================================
163167

164168
@copy_docs(ABDatabase.transaction)

tests/timetests/test_postgresqlx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def wrapper(*args, **kwargs):
1919

2020
stat = pstats.Stats(pr)
2121
stat.sort_stats(pstats.SortKey.TIME)
22-
stat.dump_stats(filename=f'time_{func.__name__}.prof')
22+
stat.dump_stats(filename=f'postgres_time_{func.__name__}.prof')
2323

2424
return wrapper
2525

tests/timetests/test_sqlite3x.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def wrapper(*args, **kwargs):
1818

1919
stat = pstats.Stats(pr)
2020
stat.sort_stats(pstats.SortKey.TIME)
21-
stat.dump_stats(filename=f'time_{func.__name__}.prof')
21+
stat.dump_stats(filename=f'sqlite_time_{func.__name__}.prof')
2222

2323
return wrapper
2424

0 commit comments

Comments
 (0)