Turso is a distributed SQLite database built on libSQL, offering HTTP-based connectivity with auth token authentication. This change adds full support: - New DatabaseType::Turso and PoolKind::Turso variants - TursoClient driver using libSQL HTTP pipeline API (/v2/pipeline) - Bearer token auth via password or url_params (auth_token=) - Multi-statement batch pipeline for transactional integrity - Standalone BEGIN/COMMIT/ROLLBACK treated as no-ops (pipeline is auto-commit) - Full metadata support: tables, columns, indexes, foreign keys, triggers, DDL - Frontend: connection form, SQL completion (SQLite syntax), capability sets - Built-in databases (SQLite/Turso/DuckDB/RQLite/Access) placed first in selector - Unit tests (15) + integration tests against live libsql-server (12) - Single connection pool, skips TCP probe Closes #948
43 lines
1.3 KiB
Rust
43 lines
1.3 KiB
Rust
use crate::agent_catalog;
|
|
use crate::models::connection::DatabaseType;
|
|
|
|
pub fn agent_key(db_type: &DatabaseType, driver_profile: Option<&str>) -> Option<&'static str> {
|
|
agent_catalog::agent_key(db_type, driver_profile)
|
|
}
|
|
|
|
pub fn is_agent_type(db_type: &DatabaseType) -> bool {
|
|
agent_catalog::is_agent_type(db_type)
|
|
}
|
|
|
|
pub fn is_single_connection_pool(db_type: &DatabaseType) -> bool {
|
|
matches!(
|
|
db_type,
|
|
DatabaseType::Sqlite
|
|
| DatabaseType::DuckDb
|
|
| DatabaseType::Rqlite
|
|
| DatabaseType::Turso
|
|
| DatabaseType::MongoDb
|
|
| DatabaseType::Oracle
|
|
| DatabaseType::Dameng
|
|
| DatabaseType::Kingbase
|
|
| DatabaseType::Highgo
|
|
| DatabaseType::Vastbase
|
|
| DatabaseType::Goldendb
|
|
| DatabaseType::Yashandb
|
|
| DatabaseType::Firebird
|
|
| DatabaseType::Iris
|
|
| DatabaseType::OceanbaseOracle
|
|
| DatabaseType::Access
|
|
| DatabaseType::Jdbc
|
|
)
|
|
}
|
|
|
|
pub fn is_metadata_connection_scoped(db_type: &DatabaseType) -> bool {
|
|
matches!(db_type, DatabaseType::Mysql)
|
|
}
|
|
|
|
pub fn skips_tcp_probe(db_type: &DatabaseType) -> bool {
|
|
matches!(db_type, DatabaseType::Sqlite | DatabaseType::DuckDb | DatabaseType::Turso | DatabaseType::Jdbc)
|
|
|| is_agent_type(db_type)
|
|
}
|