Windows compatibility fixes: Tokio macros, pgtemp gating; add DuckDB support#49
Windows compatibility fixes: Tokio macros, pgtemp gating; add DuckDB support#49danalec wants to merge 41 commits intovrmiguel:mainfrom
Conversation
Replace unwrap() with proper error handling for mutex and rwlock operations Add proper error propagation for poisoned locks in database operations Improve logging by replacing println with log macros Sanitize SQLite table names to prevent SQL injection Set different log levels for debug and release builds
Add support for configuring query batch size through PGPAD_BATCH_SIZE environment variable in both PostgreSQL and SQLite execution modules. The default remains 50 if not specified or invalid.
Also restrict test modules to unix platform for postgres database files
Add comprehensive DuckDB integration including: - New DuckDB module with parser, schema, execution, and row writing functionality - Database type registration in migrations and storage - Connection management and command handling - Schema introspection and query execution - Frontend type definitions and command bindings - Error handling and type conversions - Test coverage for all new functionality
…uery execution and schema inspection This commit introduces comprehensive Oracle database support including: - Connection management with TNS alias and wallet path support - Query execution with proper type handling and result streaming - Schema inspection for tables, views and materialized views - Numeric and blob data handling with configurable formatting - SQL parsing for Oracle-specific syntax like DESCRIBE and EXPLAIN PLAN - Integration with existing connection monitoring and storage systems
|
feat(database): enhance query execution and schema handling
|
Add Oracle database support: connection, execution, schema, settings, and keyringIntroduces Oracle support in the Tauri backend, including secure credential handling, connection monitoring, query execution (SQL and PL/SQL), EXPLAIN PLAN / DBMS_XPLAN , DESC/DESCRIBE , RETURNING INTO , OUT/IN OUT parameters, and schema introspection. Commands and types updated to support Oracle:
Configuration
Security
Tests
Migration/Compatibility
#Limitations
|
Oracle modules
Behavior
|
Add handling for INT2_ARRAY type similar to existing array types to properly format PostgreSQL smallint arrays in query results. refactor(oracle): rename raw/blob types to bytes in output Change "Raw" and "Blob" labels to "Bytes" in Oracle output for consistency and clarity. Add total length display where available.
|
- Replace seek_stream_len with seek operations for more reliable blob length calculation - Simplify conditional logic for blob preview display - Ensure consistent blob representation across all modes
Tests
|
- Add tracing, tracing-subscriber, and tracing-log dependencies - Implement structured logging with JSON output in release mode - Remove env_logger and related dependencies - Update CSP policy in tauri.conf.json - Add blob streaming test and improve error handling in oracle row writer
The INT2_ARRAY case was redundant as it's handled by the same logic as other array types. This simplifies the code while maintaining the same functionality.
- Handle NaN/infinity values in SQLite by converting to JSON strings - Add support for various PostgreSQL array types including string, numeric, date/time, and JSON arrays
…lite Implement execute_query_with_params functions for both PostgreSQL and SQLite to support parameterized queries. This allows for safer query execution by separating SQL from parameters and prevents SQL injection vulnerabilities.
…gging for sqlite Add new function to handle parameterized queries in DuckDB and implement query execution time logging for SQLite to improve debugging and performance monitoring.
The variable was renamed to follow Rust conventions for unused variables by prefixing with underscore. This improves code clarity and suppresses compiler warnings about unused variables.
Add support for parameterized queries in both SQLite and PostgreSQL backends. For SQLite, replace empty parameter queries with named parameter execution. For PostgreSQL, implement parameter parsing and binding logic including type conversion from JSON values to PostgreSQL parameter types. This enables safer query execution by properly handling user-provided parameters.
Add support for both positional and named parameters in DuckDB queries by: 1. Parsing SQL to identify parameter markers 2. Mapping JSON parameters to appropriate DuckDB types 3. Executing queries with parameters for both result and modification queries
- Add DuckDB icon and display logic in Connections component - Extend connection form to handle DuckDB database type - Add file picker and validation for DuckDB connections - Update tabs UI to include DuckDB option
…sed code - Replace `query_named` and `execute_named` with `query` and `execute` in SQLite - Remove unused `Bytes` variant from Postgres param types - Rename unused `total_rows` variables to `_total_rows` in Postgres and DuckDB
… query execution - Implement MSSQL connection handling with TLS support - Add schema introspection for tables, columns, and constraints - Support query execution with parameter binding and output clauses - Add MSSQL-specific parser for statement analysis - Implement row writing and data type handling - Add UI components for MSSQL connections and schema browsing - Include comprehensive test suite for MSSQL functionality - Add documentation and type definitions for MSSQL support
- Add multi-stage Dockerfile for building artifacts and runtime image - Include docker-compose.yml for build and runtime profiles - Add .dockerignore to exclude unnecessary files - Implement runtime entrypoint script for AppImage execution - Update README with docker usage instructions - Add GitHub Actions workflow for container builds and releases
refactor(ui): improve form components and button bindings style: fix indentation and formatting in multiple files perf: optimize logging levels in Rust backend build: update dependencies including vite and eslint plugins
|
|
This change updates all Svelte event handlers from the Svelte-specific `on:` syntax to the standard DOM `onclick` syntax for consistency and better compatibility. The functionality remains unchanged.
- Replace type assertions with proper DatabaseInfo type - Add unique keys to #each blocks in index panels - Remove unused imports and functions - Clean up connection string display logic
Configure the cargo build system to use the bfd linker for the x86_64-unknown-linux-gnu target to ensure compatibility with specific Linux environments
|
The Ubuntu CI links with rust-lld ( -fuse-ld=lld ) and crashes inside LLVM during a very large link of GTK/WebKit/DuckDB, yielding a bus error and an LLVM stack dump. #eb4b632 matches current instability in LLD on complex version-script link jobs. |
Add debuginfo=0 flag to release profile and disable debug/incremental for dev/test profiles to improve build performance and reduce binary size
…r formatting - Add I32 variant to ParamValue enum for postgres parameter handling - Improve float/double number formatting in duckdb to show .0 suffix for whole numbers - Remove unused env var fallback for batch size in sqlite - Handle utf8 strings in postgres byte array output
The default numeric precision threshold was reduced to 15 to better match common use cases and improve compatibility with standard numeric operations.
Add validation to ensure Postgres connection configuration includes at least one host. Separate SSL mode handling for 'Require' and 'Prefer' cases, with 'Prefer' now attempting fallback to NoTls on failure.
Add application_name configuration to identify pgpad connections in PostgreSQL server logs. The change is applied to all connection paths with appropriate error logging if the setting fails.
Add ability to configure Postgres session settings through environment variables: - PGPAD_CA_CERT_PATH for custom certificate path - PGPAD_STATEMENT_TIMEOUT_MS for statement timeout - PGPAD_IDLE_TX_TIMEOUT_MS for idle transaction timeout - PGPAD_SEARCH_PATH for search path configuration
Add functionality to fetch Postgres database metadata including indexes, constraints, triggers, views and foreign keys with pagination support. Each command now properly queries the database and returns structured JSON data with pagination details.
- Track Postgres backend PID when connecting to enable query cancellation - Add new cancel_postgres command to cancel running queries by PID
Implement LISTEN/UNLISTEN functionality for Postgres connections with channel validation
…gres_routines Add new command to terminate Postgres backend processes by PID. Implement proper pagination and data fetching for Postgres routines, returning schema, name, type, language and return type information in JSON format.
Add functionality to retrieve SQLite database metadata including indexes, index columns, views, view definitions, and foreign keys. Each command now supports pagination and returns structured JSON data with total pages information. The implementation uses rusqlite to query SQLite system tables and pragmas.
Add functionality to query SQLite database constraints (primary keys, unique, check) and triggers with pagination support. Also handle SQLite routines endpoint by returning empty payload since SQLite doesn't support stored routines.
Add support for configuring SQLite connection settings through environment variables including busy timeout, journal mode, and synchronous mode. This provides more control over SQLite behavior in different environments.
- Remove extra whitespace in connection_monitor.rs - Format error messages and SQL statements consistently - Improve indentation and line breaks in database commands - Standardize match statement formatting for database operations
Add #[allow(dead_code)] attribute to several database command functions that are currently unused but may be needed in the future, to suppress compiler warnings while keeping the code available.
|
allow(dead_code) temporary until future SQLCipher is achieved with SQLite |
|
I'm sorry but it's not possible to review a PR this big If you do want to merge in these features, please open small PRs that introduce them piecewise, so we can actually review them properly |
This PR improves Windows support and adds DuckDB integration.
Enable Tokio 1.47 features (macros, rt-multi-thread, time, sync) to fix #[tokio::test] diagnostics.
Implement DuckDB execution, schema introspection, and wiring in StatementManager and commands.
Gate pgtemp as Unix-only dev-dependency to avoid Unix APIs on Windows.
Clean Clippy: cargo clippy --all-targets --all-features -- -D warnings passes.
All tests pass on Windows.
Notes: