Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
2da5693
feat: fetch server databases
Rudra-Sankha-Sinhamahapatra Dec 19, 2025
7becb57
refactor: using useQuery & map
Rudra-Sankha-Sinhamahapatra Dec 20, 2025
c43c0cc
fix: database-list height issue
Rudra-Sankha-Sinhamahapatra Dec 20, 2025
56bea03
fix: merge with main
Rudra-Sankha-Sinhamahapatra Dec 21, 2025
e48c03a
Merge branch 'main' of https://github.com/wannabespace/conar into fea…
letstri Dec 22, 2025
b573321
Merge branch 'main' of https://github.com/wannabespace/conar into fea…
Rudra-Sankha-Sinhamahapatra Dec 22, 2025
a6f058b
fix: skip default databases
Rudra-Sankha-Sinhamahapatra Dec 22, 2025
fee20de
fix: show expand button only if database more than 0
Rudra-Sankha-Sinhamahapatra Dec 22, 2025
3031370
fix: merge conflicts
Rudra-Sankha-Sinhamahapatra Dec 25, 2025
4588070
fix: merge conflicts
Rudra-Sankha-Sinhamahapatra Jan 7, 2026
cbbc680
Merge branch 'main' of https://github.com/wannabespace/conar into fea…
Rudra-Sankha-Sinhamahapatra Jan 8, 2026
e11a6f5
Merge branch 'main' of https://github.com/wannabespace/conar into fea…
Rudra-Sankha-Sinhamahapatra Jan 8, 2026
11dbe23
Merge branch 'main' of https://github.com/wannabespace/conar into fea…
Rudra-Sankha-Sinhamahapatra Jan 8, 2026
34dc24f
refactor: merge with main
Rudra-Sankha-Sinhamahapatra Jan 10, 2026
5f0bc53
fix: merge conflicts
Rudra-Sankha-Sinhamahapatra Jan 23, 2026
5a3ebe0
fix: connection string false copy on toggle
Rudra-Sankha-Sinhamahapatra Jan 23, 2026
1e5fed0
refactor: made separate components for database-lists
Rudra-Sankha-Sinhamahapatra Jan 23, 2026
d4c2e37
fix: merge conflicts
Rudra-Sankha-Sinhamahapatra Jan 27, 2026
1808216
refactor: fixes merge conflict and refactor comp names
Rudra-Sankha-Sinhamahapatra Jan 28, 2026
ead5d2d
refactor: adds error handling and removed empty onKeyDown
Rudra-Sankha-Sinhamahapatra Jan 28, 2026
2862824
Merge branch 'main' of https://github.com/wannabespace/conar into fea…
Rudra-Sankha-Sinhamahapatra Jan 29, 2026
91bbee5
refactor: remove retry:5
Rudra-Sankha-Sinhamahapatra Jan 29, 2026
38de4de
fix: merge conflicts
Rudra-Sankha-Sinhamahapatra Jan 31, 2026
d60befc
Merge branch 'main' of https://github.com/wannabespace/conar into fea…
Rudra-Sankha-Sinhamahapatra Jan 31, 2026
01d23a3
refactor: remove clone connection
letstri Feb 2, 2026
f0cc3dd
Merge branch 'main' of https://github.com/wannabespace/conar into fea…
Rudra-Sankha-Sinhamahapatra Feb 4, 2026
80d4811
Merge branch 'feat/server-databases' of https://github.com/wannabespa…
Rudra-Sankha-Sinhamahapatra Feb 4, 2026
02bddef
Merge branch 'main' of https://github.com/wannabespace/conar into fea…
Rudra-Sankha-Sinhamahapatra Feb 8, 2026
a64d450
Merge branch 'main' of https://github.com/wannabespace/conar into fea…
Rudra-Sankha-Sinhamahapatra Feb 9, 2026
6b9f395
feat(connections): open server connections
Rudra-Sankha-Sinhamahapatra Feb 9, 2026
c23340d
fix: merge conflicts
Rudra-Sankha-Sinhamahapatra Feb 13, 2026
fb76135
Merge branch 'main' of https://github.com/wannabespace/conar into fea…
Rudra-Sankha-Sinhamahapatra Feb 16, 2026
54d662c
Merge branch 'main' of https://github.com/wannabespace/conar into fea…
Rudra-Sankha-Sinhamahapatra Feb 17, 2026
c9817b8
Merge branch 'main' of https://github.com/wannabespace/conar into fea…
letstri Feb 17, 2026
64fb19b
Merge branch 'main' of https://github.com/wannabespace/conar into fea…
Rudra-Sankha-Sinhamahapatra Feb 18, 2026
a0c625a
Merge branch 'main' of https://github.com/wannabespace/conar into fea…
Rudra-Sankha-Sinhamahapatra Feb 19, 2026
11d7b07
feat: implement resources
letstri Feb 23, 2026
a153d1f
Merge branch 'main' of https://github.com/wannabespace/conar into fea…
letstri Feb 23, 2026
74ed036
refactor: rename SQL references to query
letstri Feb 25, 2026
1cd2773
fix: clickhouse connections
letstri Feb 25, 2026
2fd673c
Merge branch 'main' of https://github.com/wannabespace/conar into fea…
letstri Feb 26, 2026
94d52e2
feat: new dashboard page
letstri Feb 26, 2026
30d6bc2
refactor: improve list
letstri Feb 27, 2026
0677cf8
Merge branch 'main' of https://github.com/wannabespace/conar into fea…
letstri Feb 27, 2026
82483fe
chore: update tanstack store
letstri Feb 27, 2026
b51e821
fix: lint error
Rudra-Sankha-Sinhamahapatra Mar 1, 2026
c5d4811
fix: rendering logic
Rudra-Sankha-Sinhamahapatra Mar 1, 2026
1deb49c
feat: add shadows on scroll
letstri Mar 6, 2026
5d66842
Merge branch 'feat/server-databases' of https://github.com/wannabespa…
letstri Mar 6, 2026
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
4 changes: 2 additions & 2 deletions apps/api/lib/auth.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Auth, BetterAuthOptions } from 'better-auth'
import type { BetterAuthOptions } from 'better-auth'
import { AUTH_COOKIE_PREFIX, PORTS } from '@conar/shared/constants'
import { betterAuth } from 'better-auth'
import { emailHarmony } from 'better-auth-harmony'
Expand All @@ -11,7 +11,7 @@ import { env, nodeEnv } from '~/env'
import { resend, sendEmail } from '~/lib/resend'
import { redisMemoize } from './redis'

export const auth: Auth = betterAuth({
export const auth = betterAuth({
appName: 'Conar',
secret: env.BETTER_AUTH_SECRET,
baseURL: env.API_URL,
Expand Down
1 change: 0 additions & 1 deletion apps/desktop/electron/main/connections/clickhouse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export const getClient = memoize((connectionString: string) => clickhouse.create
url: connectionString.startsWith('clickhouse')
? connectionString.replace(/^clickhouse/, 'http')
: connectionString,
max_open_connections: 1,
clickhouse_settings: {
date_time_output_format: 'iso',
},
Expand Down
58 changes: 32 additions & 26 deletions apps/desktop/electron/main/lib/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,35 @@ async function retryIfConnectionError<T>(func: () => Promise<T>, {
return result
}
catch (error) {
if (isConnectionError(error) && attempt < MAX_RECONNECTION_ATTEMPTS) {
await new Promise(resolve => setTimeout(resolve, RECONNECTION_DELAY))
onRetry?.({ attempt: attempt + 1 })
return retryIfConnectionError(func, {
attempt: attempt + 1,
onError,
onRetry,
onSuccess,
})
if (isConnectionError(error)) {
if (attempt < MAX_RECONNECTION_ATTEMPTS) {
await new Promise(resolve => setTimeout(resolve, RECONNECTION_DELAY))
onRetry?.({ attempt: attempt + 1 })
return retryIfConnectionError(func, {
attempt: attempt + 1,
onError,
onRetry,
onSuccess,
})
}
onError?.(error)
}
onError?.(error)
throw error
}
}

function retryOptions({ silent }: { silent?: boolean }) {
function retryOptions({ silent, connectionString, query }: { silent?: boolean, connectionString: string, query: string }) {
return {
onSuccess: ({ attempt }) => {
if (attempt > 0 && !silent) {
sendToast({ message: `Database connection successful after reconnection ${attempt} attempt${attempt > 1 ? 's' : ''}.`, type: 'success' })
}
},
onRetry({ attempt }) {
if (import.meta.env.DEV) {
// eslint-disable-next-line no-console
console.log('Connection string on retry', connectionString, query)
}
if (!silent) {
sendToast({ message: `Could not connect to the database. Reconnection attempt ${attempt + 1}/${MAX_RECONNECTION_ATTEMPTS}.`, type: 'info' })
}
Expand All @@ -78,27 +84,27 @@ function retryOptions({ silent }: { silent?: boolean }) {
}

const queryMap = {
postgres: async ({ connectionString, sql, values, silent }: { sql: string, values: unknown[], connectionString: string, silent?: boolean }) => {
postgres: async ({ connectionString, query, values, silent }: { query: string, values: unknown[], connectionString: string, silent?: boolean }) => {
let start = 0
const result = await retryIfConnectionError(async () => {
const pool = await getPgPool(connectionString)
start = performance.now()
return pool.query(sql, values)
}, retryOptions({ silent }))
return pool.query(query, values)
}, retryOptions({ silent, connectionString, query }))

return { result: result.rows as unknown, duration: performance.now() - start }
},
mysql: async ({ connectionString, sql, values, silent }: { sql: string, values: unknown[], connectionString: string, silent?: boolean }) => {
mysql: async ({ connectionString, query, values, silent }: { query: string, values: unknown[], connectionString: string, silent?: boolean }) => {
let start = 0
const [result] = await retryIfConnectionError(async () => {
const pool = await getMysqlPool(connectionString)
start = performance.now()
return pool.query(sql, values)
}, retryOptions({ silent }))
return pool.query(query, values)
}, retryOptions({ silent, connectionString, query }))

return { result: result as unknown, duration: performance.now() - start! }
},
clickhouse: async ({ connectionString, sql, silent }: { sql: string, connectionString: string, insertValues?: unknown[], silent?: boolean }) => {
clickhouse: async ({ connectionString, query, silent }: { query: string, connectionString: string, insertValues?: unknown[], silent?: boolean }) => {
try {
const client = getClickhouseClient(connectionString)
const isSelect = [
Expand All @@ -108,21 +114,21 @@ const queryMap = {
'EXPLAIN',
'WITH',
'CHECK',
].some(keyword => sql.trim().toUpperCase().startsWith(keyword))
].some(keyword => query.trim().toUpperCase().startsWith(keyword))
let start = 0

if (isSelect) {
const result = await retryIfConnectionError(() => {
start = performance.now()
return client.query({ query: sql, format: 'JSONEachRow' }).then(result => result.json())
}, retryOptions({ silent }))
return client.query({ query, format: 'JSONEachRow' }).then(result => result.json())
}, retryOptions({ silent, connectionString, query }))
return { result, duration: performance.now() - start }
}

await retryIfConnectionError(() => {
start = performance.now()
return client.exec({ query: sql })
}, retryOptions({ silent }))
return client.exec({ query })
}, retryOptions({ silent, connectionString, query }))

return { result: [], duration: performance.now() - start }
}
Expand All @@ -137,7 +143,7 @@ const queryMap = {
throw error
}
},
mssql: async ({ connectionString, sql, values, silent }: { sql: string, values: unknown[], connectionString: string, silent?: boolean }) => {
mssql: async ({ connectionString, query, values, silent }: { query: string, values: unknown[], connectionString: string, silent?: boolean }) => {
let start = 0

const result = await retryIfConnectionError(async () => {
Expand All @@ -149,8 +155,8 @@ const queryMap = {
}

start = performance.now()
return request.query(sql)
}, retryOptions({ silent }))
return request.query(query)
}, retryOptions({ silent, connectionString, query }))

return { result: result.recordset as unknown, duration: performance.now() - start! }
},
Expand Down
1 change: 1 addition & 0 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
"react-resizable-panels": "catalog:",
"react-scan": "catalog:",
"remark-gfm": "catalog:",
"seitu": "catalog:",
"sonner": "catalog:",
"sql-formatter": "catalog:",
"tailwindcss": "catalog:",
Expand Down
15 changes: 8 additions & 7 deletions apps/desktop/src/auth-observer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ export function AuthObserver() {
select: matches => matches.map(match => match.routeId).at(-1),
})

const isSignedInButServerError = !!bearerToken.get() && !!error

useEffect(() => {
if (data?.user) {
identifyUser(data.user.id, {
Expand All @@ -36,7 +34,7 @@ export function AuthObserver() {
* An error can be only on the server side
* To not block the app, we navigate to the home page to continue working
*/
if (isSignedInButServerError) {
if (!!bearerToken.get() && !!error) {
if (match === '/auth')
router.navigate({ to: '/' })

Expand All @@ -50,12 +48,15 @@ export function AuthObserver() {
if (!data?.user && match !== '/auth') {
router.navigate({ to: '/auth' })
}
}, [router, isPending, data?.user, match, isSignedInButServerError])
}, [router, isPending, data?.user, match, error])

useEffect(() => {
if (isSignedInButServerError && isOnline)
toast.error('Something went wrong with our server. You can continue working, but some features may not work as expected.')
}, [isSignedInButServerError, isOnline])
if (!!bearerToken.get() && !!error && isOnline) {
toast.error('Something went wrong with our server. You can continue working, but some features may not work as expected.', {
id: 'server-error',
})
}
}, [isOnline, error])

return <></>
}
2 changes: 1 addition & 1 deletion apps/desktop/src/drizzle/migrations.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"sql":["CREATE TYPE \"public\".\"database_type\" AS ENUM('postgres');","\nCREATE TABLE \"chats\" (\n\t\"id\" uuid PRIMARY KEY NOT NULL,\n\t\"created_at\" timestamp with time zone DEFAULT now() NOT NULL,\n\t\"updated_at\" timestamp with time zone DEFAULT now() NOT NULL,\n\t\"database_id\" uuid,\n\t\"title\" text\n);\n","\nCREATE TABLE \"chats_messages\" (\n\t\"id\" uuid PRIMARY KEY NOT NULL,\n\t\"created_at\" timestamp with time zone DEFAULT now() NOT NULL,\n\t\"updated_at\" timestamp with time zone DEFAULT now() NOT NULL,\n\t\"chat_id\" uuid NOT NULL,\n\t\"parts\" jsonb[] NOT NULL,\n\t\"role\" text NOT NULL,\n\t\"metadata\" jsonb\n);\n","\nCREATE TABLE \"databases\" (\n\t\"id\" uuid PRIMARY KEY NOT NULL,\n\t\"created_at\" timestamp with time zone DEFAULT now() NOT NULL,\n\t\"updated_at\" timestamp with time zone DEFAULT now() NOT NULL,\n\t\"type\" \"database_type\" NOT NULL,\n\t\"name\" text NOT NULL,\n\t\"connection_string\" text NOT NULL,\n\t\"password_exists\" boolean NOT NULL,\n\t\"password_populated\" boolean NOT NULL\n);\n","\nALTER TABLE \"chats\" ADD CONSTRAINT \"chats_database_id_databases_id_fk\" FOREIGN KEY (\"database_id\") REFERENCES \"public\".\"databases\"(\"id\") ON DELETE cascade ON UPDATE no action;","\nALTER TABLE \"chats_messages\" ADD CONSTRAINT \"chats_messages_chat_id_chats_id_fk\" FOREIGN KEY (\"chat_id\") REFERENCES \"public\".\"chats\"(\"id\") ON DELETE cascade ON UPDATE no action;"],"bps":true,"folderMillis":1754002232633,"hash":"f123164c2840b064d16ad84632eacc41dafd87c22de6e18cccb74fd73564d82c"},{"sql":["CREATE TABLE \"queries\" (\n\t\"id\" uuid PRIMARY KEY NOT NULL,\n\t\"created_at\" timestamp with time zone DEFAULT now() NOT NULL,\n\t\"updated_at\" timestamp with time zone DEFAULT now() NOT NULL,\n\t\"database_id\" uuid NOT NULL,\n\t\"name\" text NOT NULL,\n\t\"query\" text NOT NULL\n);\n","\nALTER TABLE \"queries\" ENABLE ROW LEVEL SECURITY;","\nALTER TABLE \"queries\" ADD CONSTRAINT \"queries_database_id_databases_id_fk\" FOREIGN KEY (\"database_id\") REFERENCES \"public\".\"databases\"(\"id\") ON DELETE cascade ON UPDATE no action;"],"bps":true,"folderMillis":1754340533260,"hash":"be836b889fb06cf34995ffacbcdaf774afca8341da3c65b943750a93e5fbc7f6"},{"sql":["ALTER TABLE \"queries\" DISABLE ROW LEVEL SECURITY;"],"bps":true,"folderMillis":1757364726381,"hash":"ba22013f8b1e1f55d3ed36b4439a1c22b078668b16776ce7ab10818d6e68edba"},{"sql":["CREATE TYPE \"public\".\"sync_type\" AS ENUM('cloud', 'cloud_without_password');","\nALTER TABLE \"databases\" ADD COLUMN \"sync_type\" \"sync_type\" DEFAULT 'cloud_without_password' NOT NULL;"],"bps":true,"folderMillis":1757496686890,"hash":"af8d6236dce3b252649c6a104a50737307c59584760b6038fd0648acf0f34c86"},{"sql":["ALTER TABLE \"databases\" ALTER COLUMN \"sync_type\" DROP DEFAULT;"],"bps":true,"folderMillis":1757789759178,"hash":"ecff32cda291362f4a61146b775ed8bce6c362a599fff50718427c6a7d9b65df"},{"sql":["ALTER TYPE \"public\".\"database_type\" ADD VALUE 'mysql';"],"bps":true,"folderMillis":1763463621234,"hash":"dc6bafb03500559d0e339fb91ff72344d2eac1df0fc24cdb8c9ad9888836eaf0"},{"sql":["ALTER TABLE \"databases\" ADD COLUMN \"label\" text;"],"bps":true,"folderMillis":1763508154638,"hash":"420fd9c766f22379b0793a548b4bdf8ffe81414b65da6ded6f694355691fb82f"},{"sql":["ALTER TABLE \"databases\" ADD COLUMN \"color\" text;"],"bps":true,"folderMillis":1763639625381,"hash":"e7eb83d1ceedab9185d11d3c29c6957287e3488ce4707704c94b06edf1ab6cfa"},{"sql":["ALTER TYPE \"public\".\"database_type\" ADD VALUE 'clickhouse';"],"bps":true,"folderMillis":1764513267499,"hash":"9a2e8cc7a74ab79b22c1a41a7267a7b00b62779c695b8f029da61c7b88628c64"},{"sql":["ALTER TYPE \"public\".\"database_type\" ADD VALUE 'mssql';"],"bps":true,"folderMillis":1765228275866,"hash":"634813505c3323b1f015611488fd02c1d3d88392797df9dc59b7f8dce96fd0fe"},{"sql":["ALTER TABLE \"databases\" ALTER COLUMN \"type\" SET DATA TYPE text;","\nDROP TYPE \"public\".\"database_type\";","\nCREATE TYPE \"public\".\"database_type\" AS ENUM('postgres', 'mysql', 'mssql', 'clickhouse');","\nALTER TABLE \"databases\" ALTER COLUMN \"type\" SET DATA TYPE \"public\".\"database_type\" USING \"type\"::\"public\".\"database_type\";"],"bps":true,"folderMillis":1766228230726,"hash":"cfd0ad312150f47071da5b48fef8f88e1b79fa9c4d970865c7d3e52594c4149a"},{"sql":["ALTER TABLE \"chats\" ALTER COLUMN \"database_id\" SET NOT NULL;"],"bps":true,"folderMillis":1768148789451,"hash":"d0bd62b239132645f13ce32115ffb69859a253483e5524781e3de2058510717f"},{"sql":["ALTER TYPE \"public\".\"database_type\" RENAME TO \"connection_type\";","\nALTER TABLE \"databases\" RENAME TO \"connections\";","\nALTER TABLE \"chats\" RENAME COLUMN \"database_id\" TO \"connection_id\";","\nALTER TABLE \"queries\" RENAME COLUMN \"database_id\" TO \"connection_id\";","\nALTER TABLE \"chats\" DROP CONSTRAINT \"chats_database_id_databases_id_fk\";\n","\nALTER TABLE \"queries\" DROP CONSTRAINT \"queries_database_id_databases_id_fk\";\n","\nALTER TABLE \"chats\" ADD CONSTRAINT \"chats_connection_id_connections_id_fk\" FOREIGN KEY (\"connection_id\") REFERENCES \"public\".\"connections\"(\"id\") ON DELETE cascade ON UPDATE no action;","\nALTER TABLE \"queries\" ADD CONSTRAINT \"queries_connection_id_connections_id_fk\" FOREIGN KEY (\"connection_id\") REFERENCES \"public\".\"connections\"(\"id\") ON DELETE cascade ON UPDATE no action;"],"bps":true,"folderMillis":1768945149602,"hash":"7ff9a596ff933e92bcb812a72ce126ff59df5ef1064f38f25f4e625f1194587d"}]
[{"sql":["CREATE TYPE \"public\".\"database_type\" AS ENUM('postgres');","\nCREATE TABLE \"chats\" (\n\t\"id\" uuid PRIMARY KEY NOT NULL,\n\t\"created_at\" timestamp with time zone DEFAULT now() NOT NULL,\n\t\"updated_at\" timestamp with time zone DEFAULT now() NOT NULL,\n\t\"database_id\" uuid,\n\t\"title\" text\n);\n","\nCREATE TABLE \"chats_messages\" (\n\t\"id\" uuid PRIMARY KEY NOT NULL,\n\t\"created_at\" timestamp with time zone DEFAULT now() NOT NULL,\n\t\"updated_at\" timestamp with time zone DEFAULT now() NOT NULL,\n\t\"chat_id\" uuid NOT NULL,\n\t\"parts\" jsonb[] NOT NULL,\n\t\"role\" text NOT NULL,\n\t\"metadata\" jsonb\n);\n","\nCREATE TABLE \"databases\" (\n\t\"id\" uuid PRIMARY KEY NOT NULL,\n\t\"created_at\" timestamp with time zone DEFAULT now() NOT NULL,\n\t\"updated_at\" timestamp with time zone DEFAULT now() NOT NULL,\n\t\"type\" \"database_type\" NOT NULL,\n\t\"name\" text NOT NULL,\n\t\"connection_string\" text NOT NULL,\n\t\"password_exists\" boolean NOT NULL,\n\t\"password_populated\" boolean NOT NULL\n);\n","\nALTER TABLE \"chats\" ADD CONSTRAINT \"chats_database_id_databases_id_fk\" FOREIGN KEY (\"database_id\") REFERENCES \"public\".\"databases\"(\"id\") ON DELETE cascade ON UPDATE no action;","\nALTER TABLE \"chats_messages\" ADD CONSTRAINT \"chats_messages_chat_id_chats_id_fk\" FOREIGN KEY (\"chat_id\") REFERENCES \"public\".\"chats\"(\"id\") ON DELETE cascade ON UPDATE no action;"],"bps":true,"folderMillis":1754002232633,"hash":"f123164c2840b064d16ad84632eacc41dafd87c22de6e18cccb74fd73564d82c"},{"sql":["CREATE TABLE \"queries\" (\n\t\"id\" uuid PRIMARY KEY NOT NULL,\n\t\"created_at\" timestamp with time zone DEFAULT now() NOT NULL,\n\t\"updated_at\" timestamp with time zone DEFAULT now() NOT NULL,\n\t\"database_id\" uuid NOT NULL,\n\t\"name\" text NOT NULL,\n\t\"query\" text NOT NULL\n);\n","\nALTER TABLE \"queries\" ENABLE ROW LEVEL SECURITY;","\nALTER TABLE \"queries\" ADD CONSTRAINT \"queries_database_id_databases_id_fk\" FOREIGN KEY (\"database_id\") REFERENCES \"public\".\"databases\"(\"id\") ON DELETE cascade ON UPDATE no action;"],"bps":true,"folderMillis":1754340533260,"hash":"be836b889fb06cf34995ffacbcdaf774afca8341da3c65b943750a93e5fbc7f6"},{"sql":["ALTER TABLE \"queries\" DISABLE ROW LEVEL SECURITY;"],"bps":true,"folderMillis":1757364726381,"hash":"ba22013f8b1e1f55d3ed36b4439a1c22b078668b16776ce7ab10818d6e68edba"},{"sql":["CREATE TYPE \"public\".\"sync_type\" AS ENUM('cloud', 'cloud_without_password');","\nALTER TABLE \"databases\" ADD COLUMN \"sync_type\" \"sync_type\" DEFAULT 'cloud_without_password' NOT NULL;"],"bps":true,"folderMillis":1757496686890,"hash":"af8d6236dce3b252649c6a104a50737307c59584760b6038fd0648acf0f34c86"},{"sql":["ALTER TABLE \"databases\" ALTER COLUMN \"sync_type\" DROP DEFAULT;"],"bps":true,"folderMillis":1757789759178,"hash":"ecff32cda291362f4a61146b775ed8bce6c362a599fff50718427c6a7d9b65df"},{"sql":["ALTER TYPE \"public\".\"database_type\" ADD VALUE 'mysql';"],"bps":true,"folderMillis":1763463621234,"hash":"dc6bafb03500559d0e339fb91ff72344d2eac1df0fc24cdb8c9ad9888836eaf0"},{"sql":["ALTER TABLE \"databases\" ADD COLUMN \"label\" text;"],"bps":true,"folderMillis":1763508154638,"hash":"420fd9c766f22379b0793a548b4bdf8ffe81414b65da6ded6f694355691fb82f"},{"sql":["ALTER TABLE \"databases\" ADD COLUMN \"color\" text;"],"bps":true,"folderMillis":1763639625381,"hash":"e7eb83d1ceedab9185d11d3c29c6957287e3488ce4707704c94b06edf1ab6cfa"},{"sql":["ALTER TYPE \"public\".\"database_type\" ADD VALUE 'clickhouse';"],"bps":true,"folderMillis":1764513267499,"hash":"9a2e8cc7a74ab79b22c1a41a7267a7b00b62779c695b8f029da61c7b88628c64"},{"sql":["ALTER TYPE \"public\".\"database_type\" ADD VALUE 'mssql';"],"bps":true,"folderMillis":1765228275866,"hash":"634813505c3323b1f015611488fd02c1d3d88392797df9dc59b7f8dce96fd0fe"},{"sql":["ALTER TABLE \"databases\" ALTER COLUMN \"type\" SET DATA TYPE text;","\nDROP TYPE \"public\".\"database_type\";","\nCREATE TYPE \"public\".\"database_type\" AS ENUM('postgres', 'mysql', 'mssql', 'clickhouse');","\nALTER TABLE \"databases\" ALTER COLUMN \"type\" SET DATA TYPE \"public\".\"database_type\" USING \"type\"::\"public\".\"database_type\";"],"bps":true,"folderMillis":1766228230726,"hash":"cfd0ad312150f47071da5b48fef8f88e1b79fa9c4d970865c7d3e52594c4149a"},{"sql":["ALTER TABLE \"chats\" ALTER COLUMN \"database_id\" SET NOT NULL;"],"bps":true,"folderMillis":1768148789451,"hash":"d0bd62b239132645f13ce32115ffb69859a253483e5524781e3de2058510717f"},{"sql":["ALTER TYPE \"public\".\"database_type\" RENAME TO \"connection_type\";","\nALTER TABLE \"databases\" RENAME TO \"connections\";","\nALTER TABLE \"chats\" RENAME COLUMN \"database_id\" TO \"connection_id\";","\nALTER TABLE \"queries\" RENAME COLUMN \"database_id\" TO \"connection_id\";","\nALTER TABLE \"chats\" DROP CONSTRAINT \"chats_database_id_databases_id_fk\";\n","\nALTER TABLE \"queries\" DROP CONSTRAINT \"queries_database_id_databases_id_fk\";\n","\nALTER TABLE \"chats\" ADD CONSTRAINT \"chats_connection_id_connections_id_fk\" FOREIGN KEY (\"connection_id\") REFERENCES \"public\".\"connections\"(\"id\") ON DELETE cascade ON UPDATE no action;","\nALTER TABLE \"queries\" ADD CONSTRAINT \"queries_connection_id_connections_id_fk\" FOREIGN KEY (\"connection_id\") REFERENCES \"public\".\"connections\"(\"id\") ON DELETE cascade ON UPDATE no action;"],"bps":true,"folderMillis":1768945149602,"hash":"7ff9a596ff933e92bcb812a72ce126ff59df5ef1064f38f25f4e625f1194587d"},{"sql":["CREATE TABLE \"connections_resources\" (\n\t\"id\" uuid PRIMARY KEY NOT NULL,\n\t\"created_at\" timestamp with time zone DEFAULT now() NOT NULL,\n\t\"updated_at\" timestamp with time zone DEFAULT now() NOT NULL,\n\t\"connection_id\" uuid NOT NULL,\n\t\"name\" text NOT NULL,\n\tCONSTRAINT \"connections_resources_connectionId_name_unique\" UNIQUE(\"connection_id\",\"name\")\n);\n","\nALTER TABLE \"connections_resources\" ADD CONSTRAINT \"connections_resources_connection_id_connections_id_fk\" FOREIGN KEY (\"connection_id\") REFERENCES \"public\".\"connections\"(\"id\") ON DELETE cascade ON UPDATE no action;"],"bps":true,"folderMillis":1771864823530,"hash":"6f7c6a41e3cd131a351f9ad4c8e39ddf2d3699b9117b5d61273066d39e186105"}]
Loading