Skip to content

Releases: v1a0/sqllex

SQLLEX v0.2.0.1-hotfix

12 Sep 15:25
Compare
Choose a tag to compare
  • setup/installation hotfix

SQLLEX v0.2.0.0a-hotfix

12 Sep 15:11
Compare
Choose a tag to compare
  • setup.py hotfix

SQLLEX v0.2.0.0

12 Sep 13:21
Compare
Choose a tag to compare

Changed returning data type

db.select(...) -> [(1, 'Data1'), (2, 'Data2')]

By now all select-like methods returns List[Tuple] instead of List[List]

# OLD
db.select(...) -> [[1, 'Data1'], [2, 'Data2']]

# NEW
db.select(...) -> [(1, 'Data1'), (2, 'Data2')]

PostgreSQL support

In sqllex v0.2 added basic PostgreSQL support, it's not fully functional now, but it's
in developing progress. It's based on the same structure as SQLite3x and work at the same logic.
If some constants or operator was not added yet, try to enter it as string:

from sqllex import PostgreSQLx, UNIQUE
from sqllex.constants.postgresql import INT8, SERIAL

db = PostgreSQLx(
    dbname="sqllextests",
    user="postgres",
    password="admin",
    host="127.0.0.1",
    port="5432"
)

# with inline constants
db.create_table(
    name='table1',
    columns={
        'id': SERIAL,
        'value': [INT8, UNIQUE]
    },
    IF_NOT_EXIST=True
)

# w/o inline constants
db.create_table(
    name='table2',
    columns={
        'id': "SERIAL",
        'value': "VARCHAR(32) UNIQUE"
    },
    IF_NOT_EXIST=True
)

print(db.tables_names) # ('table1', 'table2')

LIKE support + some syntax sugar

Added LIKE support, and some syntax sugar I called "column-like-regex"

from sqllex import SQLite3x, AbstractTable, AbstractColumn, LIKE

db: SQLite3x = ...
cats: AbstractTable = db['cats']
cats_color: AbstractColumn = cats['color']

dark_cats = cats.select(
    SELECT=('id', 'color'),
    WHERE=(cats_color |LIKE| "%dark%")
)

print(dark_cats)  # [(14, "dark-grey"), (42, "dark-red")]


# another way (issue #39)
dark_cats = cats.select(
    SELECT=('id', 'color'),
    WHERE={
        'color': [LIKE, "%dark%"]
    }
)

print(dark_cats)  # [(14, "dark-grey"), (42, "dark-red")]

Release candidates chronology

v0.2.0.0
  • Docs/wiki updates for v0.2.0.0
  • Fixed [LIKE, regex] for a dict init-ing issue #
  • UPDATES.md upd
v0.2.0.0-rc5
  • Added "column-like-reg_ex" (WHERE=( column |LIKE| reg_ex ))
  • Also added LIKE support (issue #39)
  • Constants upd (added psql things)
  • TableInfoError renamed to TableNotExist
  • tuple2list, return2list, lister moved to sqllex.old
  • args_parser removed (finally!!!!)
  • README upd
  • Preparing for release v0.2
v0.2.0.0-rc4
  • SearchCondition placeholder bugfix
  • AbstractTable.replace bugfix
  • " ' " -> " " "
  • psql.midleware fix
  • DEC2FLOAT, float convertion added for psql
  • speed-tests remastering
v0.2.0.0-rc3
  • JoinType renamed to JoinMethod, added JoinArgType
  • script_gens got minor update
  • postgresqlx.middleware remastering
  • postgresqlx placeholder bug fixed
  • crop_size remastered (now it's faster)
  • functools.wraps removed
  • from_as_ remastered (in progress)
  • types fix
  • JOIN logic changed a little
  • content_gen remastered
  • args_parser removed from inserting stmts
  • other minor fixes. Now it's a little faster and less glitchy
v0.2.0.0-rc2
  • Placeholders fixed
  • Docstrings remastered for SQLite3x and PostgreSQLx
  • Pragma methods and generators remover from ABDatabase and moved to sqlite3x dir
  • Auto copy docs decorator added
  • refactoring args_parser_wrapper
  • tests fixed/updated
  • preparing psqlx for release
v0.2.0.0-rc1
  • Added beta PostgreSQL support (new class PostgreSQLx)
  • Updated docs-strings for many SQLite3x methods
  • Imports optimisation
  • Changed border symbol for tables and columns names in scripts from <'> to <"> (due to postgres support)
  • New requirement "psycopg2"

SQLLEX v0.1.10.5

25 Jul 03:41
Compare
Choose a tag to compare

This is the last "SQLite-only" Sqllex ORM version

With the new updates (0.2+) base logic of scripts generation will be changed. Since sqllex v0.2 output data will not be converting from (original) tuple of tuples to list of lists, it will return "as is" instead.

There is a few reasons of these changes: tuple are faster, lighter and more reasonable for use as type of static record than list. So that's why all databases drivers use tuples.

Anyway I'll leave a few tools for converting in sqllex.other (return2list, lister, tuple2list) to simplify the process of transition to a new sqllex versions.


Changes:

  • Removed mistaken imports and requirements

SQLLEX v0.1.10.4

28 Jun 12:31
Compare
Choose a tag to compare
  • Insert method got 3x speed up (!!!) using caching
  • Select method got 1.68x speed up (!) using caching
  • Other methods got <0.1x speed up using caching
  • All string generating scripts moved to core/entities/sqlite3x/script_gens.py
  • SQLite3xTable.add_column fixed
  • Created custom logger over loguru logger, SqllexLogger
  • Typo "ConstrainType" changed to "ConstantType"
  • Updated results of speed tests

SQLLEX v0.1.10.3

19 Jun 04:23
Compare
Choose a tag to compare
  • added add_column, remove_column, has_column methods to SQLite3xTable (#22)
  • add_column, remove_column to SQLite3x class (#22)
  • tests
  • SQLite3xColumn and SQLite3xSearchCondition added to sqllex.classes

Co-Authored-By: Dominik (@asadafasab)

SQLLEX v0.1.10.2

18 Jun 09:50
Compare
Choose a tag to compare
  • Added 2 new classes SQLiteColumn and SQLite3 SearchCondition with many cool features
  • New way to set WHERE Condition
  • New way to set SET Condition
  • All select-like methods got changes in args structure (critical!)
  • Support column names with spaces
  • Bugfix
  • Tests upd
  • Info files UPDATES and WARNINGS UPD
  • fixed issue #15
  • fixed issue #23
  • fixed issue #28

SQLLEX v0.1.9.10

16 Jun 05:52
Compare
Choose a tag to compare
  • Fixing issue #26

SQLLEX v0.1.9.9

15 Jun 11:22
Compare
Choose a tag to compare
  • New method UPDATEMANY added for SQLite3x and SQLite3xTable (issue #26)
  • INSERTMNAY OR argument issue #26 fixed
  • INSERTMNAY empty array shock issue fixed, filter added
  • INSERTMNAY minor fixes
  • execute decorators got checking stmt valid
  • lgtm alerts fix
  • Other minor fixes
  • workflow (tests) fixes

Co-Authored-By: @kingabzpro

SQLLEX v0.1.9.8

14 Jun 12:55
Compare
Choose a tag to compare
  • updatemany removed
  • Issue #1 finally fixed XD