Commit Graph

9 Commits

Author SHA1 Message Date
Orthel Toralen
e51acf2932 chore: remove stale doc string. get_foreign_keys() is now supported. 2026-07-13 13:48:19 -04:00
Orthel Toralen
80717b9e0a chore: add guard for unsupported sqlalchemy versions 2026-07-10 23:52:59 -04:00
Orthel Toralen
6eb593063d docs: minor rewording to make doc strings clearer and more concise 2026-07-10 23:52:59 -04:00
Orthel Toralen
345f72fd59 refactor: remove table reflection exclusions for sqlite features now supported by Turso 2026-07-10 23:52:59 -04:00
Orthel Toralen
f7b1e21a7b fix: fix linter issues 2026-02-26 04:42:57 -05:00
Orthel Toralen
8729c9cd16 chore: remap sync_url to remote_url for libsql-sqlalchemy compatibility; break up long create_connect_args() function to please the linter 2026-02-25 00:18:06 -05:00
Orthel Toralen
5ff3a9998c test: extend testing suite to cover additional sqlalchemy-dialect cases 2026-02-25 00:18:06 -05:00
Orthel Toralen
9ca8d67694 python: fix SQLAlchemy dialect table reflection for unsupported PRAGMAs
Turso doesn't support PRAGMA foreign_key_list and PRAGMA index_list,
which SQLAlchemy uses for table reflection. This caused errors when
using Pandas df.to_sql() with if_exists='replace'.

Add _TursoDialectMixin that overrides reflection methods to return
empty results instead of executing unsupported PRAGMAs:
- get_foreign_keys() / get_multi_foreign_keys()
- get_indexes() / get_multi_indexes()
- get_unique_constraints() / get_multi_unique_constraints()
- get_check_constraints() / get_multi_check_constraints()

Foreign keys and indexes still work at runtime, they just can't be
introspected through SQLAlchemy's inspector.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-25 00:18:06 -05:00
Orthel Toralen
2456098213 python: add SQLAlchemy dialect for pyturso
Implement SQLAlchemy integration with two dialects:
- sqlite+turso:// for basic local database connections
- sqlite+turso_sync:// for sync-enabled connections with remote support

The dialects extend SQLiteDialect_pysqlite and provide:
- URL parsing for connection arguments
- get_sync_connection() helper for accessing pull/push/checkpoint/stats
- Statement caching support
- Proper isolation level handling

Also adds sqlite_version and sqlite_version_info to turso module
for SQLAlchemy compatibility checks.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-25 00:18:06 -05:00