Skip to content

Commit a8e6be4

Browse files
authored
Merge pull request #78 from Yashh56/Yashh56/fix
Release v0.9.0-rc-5
2 parents 78b993e + 8aff7bb commit a8e6be4

14 files changed

Lines changed: 547 additions & 374 deletions

File tree

bridge/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "relwave-bridge",
3-
"version": "0.9.0-rc-1",
3+
"version": "0.9.0-rc-5",
44
"type": "commonjs",
55
"main": "dist/index.cjs",
66
"scripts": {

bridge/src/services/projectStore.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,6 +1343,7 @@ export class ProjectStore {
13431343
type?: string;
13441344
ssl?: boolean;
13451345
name?: string;
1346+
url?: string;
13461347
} | null {
13471348
const get = (...keys: string[]): string | undefined => {
13481349
for (const k of keys) {
@@ -1359,9 +1360,10 @@ export class ProjectStore {
13591360
const type = get("DB_TYPE", "DATABASE_TYPE", "DB_ENGINE", "DATABASE_ENGINE");
13601361
const sslStr = get("DB_SSL", "DATABASE_SSL");
13611362
const name = get("DB_CONNECTION_NAME", "DATABASE_CONNECTION_NAME");
1363+
const url = get("DATABASE_URL", "DB_URL");
13621364

1363-
// Must have at least host or database to be useful
1364-
if (!host && !database) return null;
1365+
// Must have at least host, database, or url to be useful
1366+
if (!host && !database && !url) return null;
13651367

13661368
const port = portStr ? parseInt(portStr, 10) : undefined;
13671369
const ssl = sslStr ? !["false", "0", "no"].includes(sslStr.toLowerCase()) : undefined;
@@ -1375,6 +1377,7 @@ export class ProjectStore {
13751377
type: type?.toLowerCase(),
13761378
ssl,
13771379
name,
1380+
url,
13781381
};
13791382
}
13801383

@@ -1400,6 +1403,7 @@ export class ProjectStore {
14001403
type?: string;
14011404
ssl?: boolean;
14021405
name?: string;
1406+
url?: string;
14031407
} | null;
14041408
}> {
14051409
const sourceMetaPath = path.join(sourcePath, PROJECT_FILES.metadata);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "relwave",
33
"private": true,
4-
"version": "0.9.0-rc-1",
4+
"version": "0.9.0-rc-5",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "relwave"
3-
version = "0.9.0-rc-1"
3+
version = "0.9.0-rc-5"
44
description = "A powerful, cross-platform desktop application for database management with native Git version control."
55
authors = ["yashh56"]
66
edition = "2021"

src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "RelWave",
4-
"version": "0.9.0-rc-1",
4+
"version": "0.9.0-rc-5",
55
"identifier": "tech.relwave.app",
66
"build": {
77
"beforeDevCommand": "vite",

src/features/database/components/TablesExplorerPanel.tsx

Lines changed: 71 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ import { ScrollArea } from '@/components/ui/scroll-area';
66
import { SelectedTable, TableInfo } from "@/features/database/types";
77
import { CreateTableDialog } from '@/features/schema-explorer/components';
88
import { useTableExplorerPanel } from '../hooks/useTableExplorerPanel';
9+
import {
10+
ContextMenu,
11+
ContextMenuContent,
12+
ContextMenuItem,
13+
ContextMenuTrigger,
14+
} from "@/components/ui/context-menu";
15+
import InsertDataDialog from '@/features/database/components/InsertDataDialog';
16+
import DropTableDialog from '@/features/schema-explorer/components/DropTableDialog';
917

1018

1119
interface TablesExplorerPanelProps {
@@ -36,7 +44,11 @@ export default function TablesExplorerPanel({
3644
setFilter,
3745
toggleFavorite,
3846
filteredTables,
39-
isSelected
47+
isSelected,
48+
insertTableData,
49+
setInsertTableData,
50+
dropTableData,
51+
setDropTableData
4052
} = useTableExplorerPanel({
4153
dbId,
4254
tables,
@@ -108,36 +120,47 @@ export default function TablesExplorerPanel({
108120
</div>
109121
) : (
110122
filteredTables.map((table) => (
111-
<button
112-
key={`${table.schema}.${table.name}`}
113-
onClick={() => onSelectTable(table.name, table.schema)}
114-
className={`
115-
w-full flex items-center justify-between px-3 py-2 rounded-md
116-
transition-all duration-150 text-left group border border-transparent
117-
${isSelected(table)
118-
? 'bg-primary/10 text-primary border-primary/20 shadow-sm'
119-
: 'hover:bg-muted/55 hover:border-border/50 text-foreground'
120-
}
121-
`}
122-
>
123-
<div className="flex items-center gap-2 flex-1 min-w-0">
123+
<ContextMenu key={`${table.schema}.${table.name}`}>
124+
<ContextMenuTrigger asChild>
124125
<button
125-
onClick={(e) => {
126-
e.stopPropagation();
127-
toggleFavorite(table.name);
128-
}}
129-
className="shrink-0"
126+
onClick={() => onSelectTable(table.name, table.schema)}
127+
className={`
128+
w-full flex items-center justify-between px-3 py-2 rounded-md
129+
transition-all duration-150 text-left group border border-transparent
130+
${isSelected(table)
131+
? 'bg-primary/10 text-primary border-primary/20 shadow-sm'
132+
: 'hover:bg-muted/55 hover:border-border/50 text-foreground'
133+
}
134+
`}
130135
>
131-
<Star
132-
className={`h-3.5 w-3.5 ${favorites.has(table.name)
133-
? 'fill-yellow-500 text-yellow-500'
134-
: 'text-muted-foreground opacity-0 group-hover:opacity-100'
135-
}`}
136-
/>
136+
<div className="flex items-center gap-2 flex-1 min-w-0">
137+
<button
138+
onClick={(e) => {
139+
e.stopPropagation();
140+
toggleFavorite(table.name);
141+
}}
142+
className="shrink-0"
143+
>
144+
<Star
145+
className={`h-3.5 w-3.5 ${favorites.has(table.name)
146+
? 'fill-yellow-500 text-yellow-500'
147+
: 'text-muted-foreground opacity-0 group-hover:opacity-100'
148+
}`}
149+
/>
150+
</button>
151+
<span className="text-sm font-medium truncate font-mono">{table.name}</span>
152+
</div>
137153
</button>
138-
<span className="text-sm font-medium truncate font-mono">{table.name}</span>
139-
</div>
140-
</button>
154+
</ContextMenuTrigger>
155+
<ContextMenuContent>
156+
<ContextMenuItem onClick={() => setInsertTableData(table)}>
157+
Insert Data
158+
</ContextMenuItem>
159+
<ContextMenuItem onClick={() => setDropTableData(table)} className="text-destructive">
160+
Delete Table
161+
</ContextMenuItem>
162+
</ContextMenuContent>
163+
</ContextMenu>
141164
))
142165
)}
143166
</div>
@@ -155,6 +178,26 @@ export default function TablesExplorerPanel({
155178
onOpenChange={setCreateTableOpen}
156179
schemaName={selectedSchema}
157180
/>
181+
182+
{insertTableData && (
183+
<InsertDataDialog
184+
open={!!insertTableData}
185+
onOpenChange={(open) => !open && setInsertTableData(null)}
186+
dbId={dbId}
187+
schemaName={insertTableData.schema || "public"}
188+
tableName={insertTableData.name}
189+
/>
190+
)}
191+
192+
{dropTableData && (
193+
<DropTableDialog
194+
open={!!dropTableData}
195+
onOpenChange={(open) => !open && setDropTableData(null)}
196+
dbId={dbId}
197+
schemaName={dropTableData.schema || "public"}
198+
tableName={dropTableData.name}
199+
/>
200+
)}
158201
</div>
159202
</div>
160203
);

src/features/database/hooks/useTableExplorerPanel.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export function useTableExplorerPanel({
1717
}: TablesExplorerPanelProps) {
1818
const [searchQuery, setSearchQuery] = useState('');
1919
const [createTableOpen, setCreateTableOpen] = useState(false);
20+
const [insertTableData, setInsertTableData] = useState<TableInfo | null>(null);
21+
const [dropTableData, setDropTableData] = useState<TableInfo | null>(null);
2022

2123
const [favorites, setFavorites] = useState<Set<string>>(
2224
new Set(JSON.parse(localStorage.getItem('favoriteTables') || '[]'))
@@ -58,6 +60,10 @@ export function useTableExplorerPanel({
5860
setFilter,
5961
toggleFavorite,
6062
filteredTables,
61-
isSelected
63+
isSelected,
64+
insertTableData,
65+
setInsertTableData,
66+
dropTableData,
67+
setDropTableData
6268
};
6369
}

0 commit comments

Comments
 (0)