Releases: JSLEEKR/sqlink
Releases · JSLEEKR/sqlink
Release list
v1.0.0 — sqlink
Changelog
All notable changes to sqlink are documented in this file.
Format: [version] YYYY-MM-DD — description
[1.0.0] 2026-03-27 — Production release
Added — Core Builder
Queryclass: fluent chain API for SELECT, INSERT, UPDATE, DELETETablehelper: table-scoped query factory with optional dialect binding.clone()for safe query branching via deep copy__repr__/__str__onQueryandExpr— build-time introspection.comment()and.label()for/* ... */SQL comments and APM tracing tags
Added — Expressions
F()field reference with full operator overloading (==,!=,>,>=,<,<=)And,Or,Notvia Python&,|,~operatorsBetween,In,NotIn,Like,ILike,IsNull,IsNotNullCaseWHEN/THEN/ELSE expression builderExistsfor correlated subquery conditionsSubquerywrapper for FROM/IN subqueriesAliasvia.as_()on anyExprRawfor opt-in raw SQL fragments with optional paramsFuncfor arbitrary SQL function callsWindowfor window functions withPARTITION BY,ORDER BY, and frame specsOrderExprwith.asc()/.desc()onF()
Added — SQL Clauses
.select(),.select_all(),.add_select(),.distinct(),.distinct_on().from_table(),.from_subquery().where(),.where_raw().join(),.left_join(),.right_join(),.full_join(),.cross_join(),.join_raw().group_by(),.having().order_by(),.order_by_asc(),.order_by_desc().limit(),.offset(),.paginate().insert(),.values(),.from_select().on_conflict(),.on_conflict_do_nothing().update(),.set().delete().returning().with_cte()(including recursive CTEs).union(),.union_all(),.intersect(),.except_().for_update(),.for_share()row-level locking
Added — Dialects
Dialectbase:?placeholders, double-quote identifiersPostgreSQLDialect:$1-style numbered placeholders, ILIKE, RETURNING, ON CONFLICTMySQLDialect:%splaceholders, backtick identifiers, ON DUPLICATE KEY UPDATESQLiteDialect:?placeholders, RETURNING (3.35+), ON CONFLICT
Added — Aggregates & Functions
Count,Sum,Avg,Max,Minwith optionaldistinct=TrueCoalesce,Greatest,Least,Concat,CastLower,Upper,Trim,Length,Round,AbsNow,CurrentTimestamp
Added — Date/Time (date_ops.py)
DateTrunc(precision, column)— DATE_TRUNCExtract(part, column)— EXTRACT(PART FROM column)DateAdd(column, value, unit)— column + INTERVAL 'N unit'DateSub(column, value, unit)— column - INTERVAL 'N unit'DateDiff(col1, col2)— col1 - col2Age(column, reference?)— PostgreSQL AGE()- Convenience:
Year,Month,Day,Hour,Minute,CurrentDate,CurrentTime
Added — JSON/JSONB (json_ops.py)
JsonFieldwith path traversal via.arrow(),.text(),.arrow_index()JsonContains(@>),JsonContainedBy(<@)JsonHasKey(?),JsonHasAnyKey(?|),JsonHasAllKeys(?&)- Comparison operators on
JsonFieldfor WHERE conditions
Added — Schema Builder (schema.py)
SchemawithCREATE TABLE IF NOT EXISTSandDROP TABLE [CASCADE]Columnwith type, nullable, default, primary_key, unique, max_lengthForeignKeywith ON DELETE / ON UPDATE actions
Added — DDL (ddl.py)
CreateIndex/DropIndexwith UNIQUE and IF [NOT] EXISTSTruncatewith CASCADE and RESTART IDENTITYCreateView/DropViewwith OR REPLACE, IF EXISTS, CASCADE
Added — Migration Builder (migration.py)
AlterTable: add/drop/rename column, alter column type- SET/DROP NOT NULL, SET/DROP DEFAULT
- ADD/DROP UNIQUE constraint, DROP CONSTRAINT
- ADD/DROP INDEX (with CREATE INDEX SQL)
- ADD FOREIGN KEY
- RENAME TABLE
Added — Transaction Builder (transaction.py)
Transactionwith BEGIN / COMMIT / ROLLBACK- Configurable isolation level (
SERIALIZABLE,READ COMMITTED, etc.) - SAVEPOINT, ROLLBACK TO SAVEPOINT, RELEASE SAVEPOINT
Added — Query Composition (compose.py)
Scope: reusable query modifier with&combinatorQueryTemplate: parameterized query factoryPaginator: stateful pagination with.page(n)and.count_query()ConditionalBuilder:.when()/.unless()conditional clause applicationBatchInsert: chunked multi-row inserts with configurablechunk_size
Added — Debug Tools (debug.py)
interpolate_params(): inline param substitution for loggingexplain_query(): clause detection, complexity scoring, param countingformat_sql(): keyword-based SQL pretty-printing with indentation
Added — Rendering Utilities (renderer.py)
to_dict(): query metadata as structured dictto_json(): JSON serialization with indentto_prepared():{text, values}format for DB driversto_raw_sql(): debug-only interpolated SQLto_all_dialects(): build same query in all four dialectsrender_migration(): join AlterTable statements into a migration script
Added — Validation (validation.py)
validate_identifier(): safe identifier check with SQL injection pattern detectionvalidate_table_name(),validate_column_name()check_dangerous_value(): secondary defense scan on string valuessanitize_order_direction(): restrict to ASC / DESCvalidate_limit(),validate_offset()
Added — Type Safety
- Full type annotations on all public APIs
py.typedPEP 561 marker for mypy / pyright support__all__exports in__init__.py
Tests
- 652 tests across 28 test files
- Coverage: builder, expressions, all dialects, CTEs, UNION, subqueries
- Window functions, aggregates, date/time, JSON/JSONB
- Schema, DDL, migration, transaction, composition
- Rendering, validation, debug tools
- Type safety, repr/str, error handling
- Real-world integration scenarios (e-commerce, analytics, auth flows)
- Stress tests: 1000-row batch inserts, 20-CTE chains, deeply nested conditions