Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ coverage/
*.dll
*.exe
design-front/
docker/sqlite/data/
12 changes: 12 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# Redis port 6379 no auth keys prefix querya:*
# MongoDB port 27017 db querya user querya password querya
# auth source: admin collections: users, products, orders
# SQLite local file ./sqlite/data/querya.db
# tables: users, products, orders
# ─────────────────────────────────────────────────────────────────────────

name: querya-dev
Expand Down Expand Up @@ -135,6 +137,16 @@ services:
retries: 20
start_period: 30s

sqlite-seed:
image: alpine:latest
container_name: querya-sqlite-seed
volumes:
- ./sqlite/data:/data
- ./sqlite/init.sql:/init.sql:ro
command: >
sh -c "apk add --no-cache sqlite && sqlite3 /data/querya.db < /init.sql && chmod 666 /data/querya.db && echo 'SQLite DB seeded'"
restart: "no"

volumes:
postgres_data:
mysql_data:
Expand Down
41 changes: 41 additions & 0 deletions docker/sqlite/init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
-- Querya SQLite Test Database Initialization
-- This script runs once via Docker to seed the local querya.db file.

CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username TEXT NOT NULL,
email TEXT NOT NULL UNIQUE,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE IF NOT EXISTS products (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
price REAL NOT NULL,
stock INTEGER DEFAULT 0
);

CREATE TABLE IF NOT EXISTS orders (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER NOT NULL,
total REAL NOT NULL,
status TEXT DEFAULT 'pending',
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY(user_id) REFERENCES users(id)
);

-- Seed Data
INSERT OR IGNORE INTO users (id, username, email) VALUES
(1, 'alice_smith', 'alice@example.com'),
(2, 'bob_jones', 'bob@example.com'),
(3, 'charlie_brown', 'charlie@example.com');

INSERT OR IGNORE INTO products (id, name, price, stock) VALUES
(1, 'Laptop Pro', 1299.99, 50),
(2, 'Wireless Mouse', 49.99, 200),
(3, 'Mechanical Keyboard', 149.50, 75);

INSERT OR IGNORE INTO orders (id, user_id, total, status) VALUES
(1, 1, 1299.99, 'completed'),
(2, 2, 49.99, 'shipped'),
(3, 1, 149.50, 'pending');
59 changes: 32 additions & 27 deletions lib/core/layout/vertical_split_pane.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class SplitPanePair extends StatelessWidget {
}

/// Vertical split whose drag updates [fraction] without rebuilding [top]/[bottom].
class VerticalSplitPane extends StatelessWidget {
class VerticalSplitPane extends StatefulWidget {
const VerticalSplitPane({
super.key,
required this.fraction,
Expand All @@ -31,36 +31,41 @@ class VerticalSplitPane extends StatelessWidget {
final double maxFraction;
final Key? handleKey;

@override
State<VerticalSplitPane> createState() => _VerticalSplitPaneState();
}

class _VerticalSplitPaneState extends State<VerticalSplitPane> {
final GlobalKey _columnKey = GlobalKey();

@override
Widget build(BuildContext context) {
return LayoutBuilder(
builder: (context, constraints) {
final totalHeight = constraints.maxHeight;
return ValueListenableBuilder<double>(
valueListenable: fraction,
builder: (context, value, panes) {
final pair = panes! as SplitPanePair;
final topFlex = (value * 100).round().clamp(20, 80).toInt();
final bottomFlex = 100 - topFlex;
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Expanded(flex: topFlex, child: pair.top),
_VerticalSplitHandle(
key: handleKey,
onDrag: (dy) {
if (totalHeight <= 0) return;
fraction.value = (fraction.value + dy / totalHeight)
.clamp(minFraction, maxFraction);
},
),
Expanded(flex: bottomFlex, child: pair.bottom),
],
);
},
child: SplitPanePair(top: top, bottom: bottom),
return ValueListenableBuilder<double>(
valueListenable: widget.fraction,
builder: (context, value, panes) {
final pair = panes! as SplitPanePair;
final topFlex = (value * 100).round().clamp(20, 80).toInt();
final bottomFlex = 100 - topFlex;
return Column(
key: _columnKey,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Expanded(flex: topFlex, child: pair.top),
_VerticalSplitHandle(
key: widget.handleKey,
onDrag: (dy) {
final box = _columnKey.currentContext?.findRenderObject() as RenderBox?;
final totalHeight = box?.size.height ?? 0;
if (totalHeight <= 0) return;
widget.fraction.value = (widget.fraction.value + dy / totalHeight)
.clamp(widget.minFraction, widget.maxFraction);
},
),
Expanded(flex: bottomFlex, child: pair.bottom),
],
);
},
child: SplitPanePair(top: widget.top, bottom: widget.bottom),
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/core/theme/parser/querya_theme_color_scheme.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: deprecated_member_use

import 'package:flutter/foundation.dart';
import 'package:shadcn_flutter/shadcn_flutter.dart';

Expand Down Expand Up @@ -64,7 +66,6 @@ ColorScheme colorSchemeFromQueryaThemeColors({

final destructive = pick('destructive', base.destructive);
// querya.theme.v1 still maps this key; shadcn marks the ColorScheme field legacy.
// ignore: deprecated_member_use
final destructiveForeground =
pick('destructiveForeground', base.destructiveForeground);

Expand All @@ -85,7 +86,6 @@ ColorScheme colorSchemeFromQueryaThemeColors({
accent: pick('accent', base.accent),
accentForeground: pick('accentForeground', base.accentForeground),
destructive: destructive,
// ignore: deprecated_member_use
destructiveForeground: destructiveForeground,
border: pick('border', base.border),
input: pick('input', base.input),
Expand Down
5 changes: 3 additions & 2 deletions lib/features/main_screen/workspace_panel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import 'package:flutter/material.dart' as material
SingleChildScrollView,
Row,
MainAxisSize,
Widget;
Widget,
BoxConstraints;
import 'package:querya_desktop/core/layout/vertical_split_pane.dart';
import 'package:querya_desktop/core/motion/querya_cross_fade_stack.dart';
import 'package:querya_desktop/core/motion/querya_motion.dart';
Expand Down Expand Up @@ -307,7 +308,7 @@ class _SectionBar extends StatelessWidget {
Widget build(BuildContext context) {
final theme = Theme.of(context);
return material.Container(
height: 44,
constraints: const material.BoxConstraints(minHeight: 44),
padding: const material.EdgeInsets.symmetric(horizontal: 12),
decoration: material.BoxDecoration(
color: theme.colorScheme.muted.withValues(alpha: 0.6),
Expand Down
2 changes: 1 addition & 1 deletion lib/features/mongodb/mongo_documents_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ class _MongoDocumentsViewState extends material.State<MongoDocumentsView> {
final to = (_skip + _limit).clamp(0, _totalCount);

return material.Container(
height: 44,
constraints: const material.BoxConstraints(minHeight: 44),
padding: const material.EdgeInsets.symmetric(horizontal: 16),
decoration: material.BoxDecoration(
color: shadcnCs.muted.withValues(alpha: 0.15),
Expand Down
2 changes: 1 addition & 1 deletion lib/features/mongodb/mongo_explorer_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ class _BreadcrumbBar extends StatelessWidget {
material.Widget build(material.BuildContext context) {
final cs = shadcn.Theme.of(context).colorScheme;
return material.Container(
height: 44,
constraints: const material.BoxConstraints(minHeight: 44),
padding: const material.EdgeInsets.symmetric(horizontal: 16),
decoration: material.BoxDecoration(
color: cs.muted.withValues(alpha: 0.3),
Expand Down
18 changes: 12 additions & 6 deletions lib/features/mongodb/mongo_stats_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -765,10 +765,12 @@ class _MongoStatsViewState extends material.State<MongoStatsView> {
Map<String, String> _extractServerInfo(Map<String, dynamic> status) {
final result = <String, String>{};
if (status['host'] != null) result['Host'] = status['host'].toString();
if (status['version'] != null)
if (status['version'] != null) {
result['Version'] = status['version'].toString();
if (status['process'] != null)
}
if (status['process'] != null) {
result['Process'] = status['process'].toString();
}
final uptime = _getInt(status, 'uptime');
if (uptime != null) {
result['Uptime'] = '${_formatUptime(uptime)} ($uptime s)';
Expand All @@ -791,12 +793,15 @@ class _MongoStatsViewState extends material.State<MongoStatsView> {
final result = <String, String>{};
final repl = status['repl'] as Map<String, dynamic>?;
if (repl != null) {
if (repl['setName'] != null)
if (repl['setName'] != null) {
result['Replica set'] = repl['setName'].toString();
if (repl['ismaster'] != null)
}
if (repl['ismaster'] != null) {
result['Is master'] = repl['ismaster'].toString();
if (repl['secondary'] != null)
}
if (repl['secondary'] != null) {
result['Secondary'] = repl['secondary'].toString();
}
}
return result;
}
Expand All @@ -819,8 +824,9 @@ class _MongoStatsViewState extends material.State<MongoStatsView> {
String _formatBytes(int bytes) {
if (bytes < 1024) return '$bytes B';
if (bytes < 1024 * 1024) return '${(bytes / 1024).toStringAsFixed(1)} KB';
if (bytes < 1024 * 1024 * 1024)
if (bytes < 1024 * 1024 * 1024) {
return '${(bytes / (1024 * 1024)).toStringAsFixed(1)} MB';
}
return '${(bytes / (1024 * 1024 * 1024)).toStringAsFixed(1)} GB';
}
}
Loading
Loading