refactor: Flatten directory structure

Move project files from uzdb/ subdirectory to root directory for cleaner project structure.

Changes:
- Move frontend/ to root
- Move internal/ to root
- Move build/ to root
- Move all config files (go.mod, wails.json, etc.) to root
- Remove redundant uzdb/ subdirectory nesting

Project structure is now:
├── frontend/        # React application
├── internal/        # Go backend
├── build/           # Wails build assets
├── doc/             # Design documentation
├── main.go          # Entry point
└── ...

🤖 Generated with Qoder
This commit is contained in:
loveuer
2026-04-04 07:14:00 -07:00
parent 5a83e86bc9
commit 9874561410
83 changed files with 0 additions and 46 deletions

View File

@@ -0,0 +1,134 @@
/**
* Mock Database Connections Data
*
* Sample data for development and testing purposes.
*/
import { DatabaseConnection } from '../components/Sidebar/ConnectionPanel';
/**
* Sample database connections
*/
export const mockConnections: DatabaseConnection[] = [
{
id: 'conn-1',
name: 'MySQL @ localhost',
type: 'mysql',
host: 'localhost',
port: 3306,
status: 'active',
databases: [
{
id: 'schema-1',
name: 'public',
tables: [
{ id: 'table-1', name: 'users', schema: 'public' },
{ id: 'table-2', name: 'products', schema: 'public' },
{ id: 'table-3', name: 'orders', schema: 'public' },
{ id: 'table-4', name: 'order_items', schema: 'public' },
{ id: 'table-5', name: 'categories', schema: 'public' },
],
views: [
{ id: 'view-1', name: 'active_users' },
{ id: 'view-2', name: 'product_stats' },
],
functions: [
{ id: 'func-1', name: 'calculate_total' },
{ id: 'func-2', name: 'get_user_role' },
],
procedures: [
{ id: 'proc-1', name: 'sp_create_order' },
{ id: 'proc-2', name: 'sp_update_inventory' },
],
},
{
id: 'schema-2',
name: 'information_schema',
tables: [],
},
],
},
{
id: 'conn-2',
name: 'PostgreSQL @ prod-db',
type: 'postgresql',
host: 'prod-db.example.com',
port: 5432,
status: 'connected',
databases: [
{
id: 'schema-3',
name: 'public',
tables: [
{ id: 'table-6', name: 'customers', schema: 'public' },
{ id: 'table-7', name: 'transactions', schema: 'public' },
{ id: 'table-8', name: 'audit_log', schema: 'public' },
],
views: [{ id: 'view-3', name: 'customer_summary' }],
functions: [{ id: 'func-3', name: 'generate_report' }],
procedures: [],
},
],
},
{
id: 'conn-3',
name: 'SQLite @ local',
type: 'sqlite',
status: 'disconnected',
databases: [],
},
{
id: 'conn-4',
name: 'MariaDB @ staging',
type: 'mariadb',
host: 'staging.example.com',
port: 3306,
status: 'error',
databases: [],
},
{
id: 'conn-5',
name: 'MySQL @ dev-server',
type: 'mysql',
host: 'dev.example.com',
port: 3306,
status: 'connecting',
databases: [],
},
];
/**
* Get connection by ID
*/
export const getConnectionById = (id: string): DatabaseConnection | undefined => {
return mockConnections.find((conn) => conn.id === id);
};
/**
* Get connections by status
*/
export const getConnectionsByStatus = (status: DatabaseConnection['status']): DatabaseConnection[] => {
return mockConnections.filter((conn) => conn.status === status);
};
/**
* Add a new mock connection (for testing)
*/
export const addMockConnection = (connection: DatabaseConnection): void => {
mockConnections.push(connection);
};
/**
* Update connection status (for testing)
*/
export const updateConnectionStatus = (
id: string,
status: DatabaseConnection['status']
): void => {
const conn = mockConnections.find((c) => c.id === id);
if (conn) {
conn.status = status;
}
};
export default mockConnections;

View File

@@ -0,0 +1,232 @@
/**
* Mock Query Results Data
*
* Sample data for development and testing purposes.
*/
import { QueryResult, QueryTab } from '../components/MainArea/QueryEditor';
import { TableColumn, Index, ForeignKey, TableInfo } from '../components/MainArea/TableStructure';
import { Column, DataRow } from '../components/MainArea/DataGrid';
/**
* Sample query results
*/
export const mockQueryResults: QueryResult = {
columns: ['id', 'name', 'email', 'created_at', 'active', 'role'],
rows: [
[1, 'Alice Johnson', 'alice@example.com', '2024-01-15 10:30:00', true, 'admin'],
[2, 'Bob Smith', 'bob@example.com', '2024-01-16 14:22:00', true, 'user'],
[3, 'Carol Williams', 'carol@example.com', '2024-01-17 09:15:00', false, 'user'],
[4, 'David Brown', 'david@example.com', '2024-01-18 16:45:00', true, 'moderator'],
[5, 'Eve Davis', 'eve@example.com', '2024-01-19 11:00:00', true, 'user'],
[6, 'Frank Miller', 'frank@example.com', '2024-01-20 08:30:00', true, 'user'],
[7, 'Grace Wilson', 'grace@example.com', '2024-01-21 13:20:00', true, 'user'],
[8, 'Henry Moore', 'henry@example.com', '2024-01-22 15:10:00', false, 'user'],
[9, 'Ivy Taylor', 'ivy@example.com', '2024-01-23 10:45:00', true, 'admin'],
[10, 'Jack Anderson', 'jack@example.com', '2024-01-24 12:00:00', true, 'user'],
],
rowCount: 127,
executionTime: 0.045,
message: '127 rows affected',
};
/**
* Sample error query result
*/
export const mockErrorResult: QueryResult = {
columns: [],
rows: [],
error: "ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELEC * FROM users' at line 1",
};
/**
* Sample query tabs
*/
export const mockQueryTabs: QueryTab[] = [
{
id: 'tab-1',
title: 'query_1.sql',
content: `-- Get active users with their orders
SELECT
u.id,
u.name,
u.email,
COUNT(o.id) as order_count
FROM users u
LEFT JOIN orders o ON u.id = o.user_id
WHERE u.active = true
AND u.created_at >= '2024-01-01'
GROUP BY u.id, u.name, u.email
HAVING COUNT(o.id) > 0
ORDER BY order_count DESC
LIMIT 100;`,
isDirty: false,
},
{
id: 'tab-2',
title: 'unsaved_query.sql',
content: `SELECT * FROM products WHERE price > 100;`,
isDirty: true,
},
];
/**
* Sample table columns
*/
export const mockTableColumns: TableColumn[] = [
{
name: 'id',
type: 'INT',
nullable: false,
isPrimaryKey: true,
extra: 'auto_increment',
},
{
name: 'name',
type: 'VARCHAR(100)',
nullable: false,
},
{
name: 'email',
type: 'VARCHAR(255)',
nullable: false,
isUnique: true,
},
{
name: 'created_at',
type: 'TIMESTAMP',
nullable: true,
defaultValue: 'NOW()',
},
{
name: 'active',
type: 'BOOLEAN',
nullable: false,
defaultValue: 'TRUE',
},
{
name: 'role',
type: 'ENUM(\'user\', \'admin\', \'moderator\')',
nullable: false,
defaultValue: "'user'",
},
];
/**
* Sample indexes
*/
export const mockIndexes: Index[] = [
{
name: 'PRIMARY',
type: 'BTREE',
columns: ['id'],
isUnique: true,
method: 'BTREE',
},
{
name: 'idx_email',
type: 'BTREE',
columns: ['email'],
isUnique: true,
method: 'BTREE',
},
{
name: 'idx_created_at',
type: 'BTREE',
columns: ['created_at'],
isUnique: false,
method: 'BTREE',
},
];
/**
* Sample foreign keys
*/
export const mockForeignKeys: ForeignKey[] = [
{
name: 'fk_user_role',
column: 'role_id',
referencesTable: 'roles',
referencesColumn: 'id',
onUpdate: 'CASCADE',
onDelete: 'SET NULL',
},
{
name: 'fk_user_department',
column: 'department_id',
referencesTable: 'departments',
referencesColumn: 'id',
onUpdate: 'CASCADE',
onDelete: 'RESTRICT',
},
];
/**
* Sample table info
*/
export const mockTableInfo: TableInfo = {
engine: 'InnoDB',
collation: 'utf8mb4_unicode_ci',
rowCount: 1247,
size: '256 KB',
autoIncrement: 1248,
comment: 'User accounts table',
};
/**
* Sample data grid columns
*/
export const mockDataGridColumns: Column[] = [
{ id: 'id', name: 'ID', type: 'INT', width: 80, sortable: true },
{ id: 'name', name: 'Name', type: 'VARCHAR', width: 200, sortable: true, editable: true },
{ id: 'email', name: 'Email', type: 'VARCHAR', width: 250, sortable: true, editable: true },
{ id: 'created_at', name: 'Created At', type: 'TIMESTAMP', width: 180, sortable: true },
{ id: 'active', name: 'Active', type: 'BOOLEAN', width: 80, sortable: true, editable: true },
{ id: 'role', name: 'Role', type: 'ENUM', width: 120, sortable: true, editable: true },
];
/**
* Sample data grid rows
*/
export const mockDataGridRows: DataRow[] = [
{ id: 1, name: 'Alice Johnson', email: 'alice@example.com', created_at: '2024-01-15', active: true, role: 'admin' },
{ id: 2, name: 'Bob Smith', email: 'bob@example.com', created_at: '2024-01-16', active: true, role: 'user' },
{ id: 3, name: 'Carol Williams', email: 'carol@example.com', created_at: '2024-01-17', active: false, role: 'user' },
{ id: 4, name: 'David Brown', email: 'david@example.com', created_at: '2024-01-18', active: true, role: 'moderator' },
{ id: 5, name: 'Eve Davis', email: 'eve@example.com', created_at: '2024-01-19', active: true, role: 'user' },
{ id: 6, name: 'Frank Miller', email: 'frank@example.com', created_at: '2024-01-20', active: true, role: 'user' },
{ id: 7, name: 'Grace Wilson', email: 'grace@example.com', created_at: '2024-01-21', active: true, role: 'user' },
{ id: 8, name: 'Henry Moore', email: 'henry@example.com', created_at: '2024-01-22', active: false, role: 'user' },
{ id: 9, name: 'Ivy Taylor', email: 'ivy@example.com', created_at: '2024-01-23', active: true, role: 'admin' },
{ id: 10, name: 'Jack Anderson', email: 'jack@example.com', created_at: '2024-01-24', active: true, role: 'user' },
];
/**
* Generate more rows for testing pagination
*/
export const generateMockRows = (count: number): DataRow[] => {
const roles = ['user', 'admin', 'moderator'];
const firstNames = ['Alice', 'Bob', 'Carol', 'David', 'Eve', 'Frank', 'Grace', 'Henry', 'Ivy', 'Jack'];
const lastNames = ['Johnson', 'Smith', 'Williams', 'Brown', 'Davis', 'Miller', 'Wilson', 'Moore', 'Taylor', 'Anderson'];
return Array.from({ length: count }, (_, i) => ({
id: i + 1,
name: `${firstNames[i % firstNames.length]} ${lastNames[i % lastNames.length]}`,
email: `user${i + 1}@example.com`,
created_at: `2024-01-${((i % 31) + 1).toString().padStart(2, '0')}`,
active: i % 5 !== 0,
role: roles[i % roles.length],
}));
};
export default {
mockQueryResults,
mockErrorResult,
mockQueryTabs,
mockTableColumns,
mockIndexes,
mockForeignKeys,
mockTableInfo,
mockDataGridColumns,
mockDataGridRows,
};