Open
Description
ref: https://github.com/FLEXTool/FLEX?tab=readme-ov-file#sqlite-browser
Description
Introduce a robust database browser in DebugSwift for exploring SQLite and Realm database files. This feature will allow developers to view, sort, and analyze data within their app's databases directly during runtime, enhancing debugging efficiency and data inspection capabilities.
Proposed Features
-
Database File Support:
- Support for
.db
,.sqlite
, and Realm database files. - Automatically detect and list available database files in the app's sandbox.
- Support for
-
Table Viewer:
- Display all tables in the selected database.
- Show table schemas (column names, types, constraints).
- Allow sorting rows by tapping column headers.
-
Data Interaction:
- Search: Add a search bar for filtering rows based on column values.
- Edit: Enable inline editing of table rows for SQLite databases.
- Insert: Allow adding new rows to tables.
- Delete: Provide options to delete individual rows or truncate tables.
-
Advanced Querying:
- Add a SQL query editor for running custom queries on SQLite databases.
- Display query results in a table format.
-
Realm-Specific Features:
- Support for exploring Realm objects with relationships and nested structures.
- Display object schemas and allow editing of individual properties.
-
Export and Import:
- Export database contents or query results as CSV or JSON.
- Import data from external files to update tables.
-
User Interface:
- Organized layout with a sidebar for navigating databases and tables.
- Highlight modified rows or cells for better tracking.
Use Cases
- Debugging database-related issues by inspecting and modifying data directly.
- Testing app behavior with different data configurations.
- Analyzing and exporting data for offline review or reporting.
Technical Considerations
- Use SQLite APIs for database interaction and maintain compatibility with Swift.
- For Realm, leverage the Realm Swift SDK to access objects and schemas.
- Ensure the browser handles large databases efficiently with pagination or lazy loading.
Additional Notes
This feature aligns with DebugSwift’s goal of providing comprehensive debugging tools, enabling developers to work seamlessly with their app’s databases without switching to external tools.