Skip to content

Commit

Permalink
Merge pull request #127 from garrylachman/121-remove-better-sql
Browse files Browse the repository at this point in the history
remove better-sql3
close #121
  • Loading branch information
garrylachman authored Feb 14, 2023
2 parents 46eab05 + d67ea66 commit 4230295
Show file tree
Hide file tree
Showing 17 changed files with 20 additions and 129 deletions.
1 change: 1 addition & 0 deletions config/webpack.main.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const mainConfig: Configuration = {
nock: 'nock',
oracledb: 'oracledb',
'pg-native': 'pg-native',
'better-sqlite3': 'better-sqlite3',
},
// Put your normal webpack config below here
module: {
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@
"@chakra-ui/transition": "^2.0.15",
"@chakra-ui/utils": "^2.0.15",
"@day1co/fastcase": "github:garrylachman/fastcase#main",
"@electrocrud/shared": "link:./packages/shared",
"@electrocrud/utils": "link:./packages/utils",
"@electrocrud/buttons": "link:./packages/buttons",
"@electrocrud/feedback": "link:./packages/feedback",
"@electrocrud/shared": "link:./packages/shared",
"@electrocrud/tables": "link:./packages/tables",
"@electrocrud/utils": "link:./packages/utils",
"@emotion/cache": "^11.7.1",
"@emotion/react": "^11",
"@emotion/styled": "^11",
Expand Down Expand Up @@ -113,7 +113,6 @@
"@uiw/react-markdown-editor": "^5.10.1",
"add": "^2.0.6",
"arc-hash": "^3.0.0",
"better-sqlite3": "^8.1.0",
"chroma-js": "^2.4.2",
"crypto-browserify": "^3.12.0",
"crypto-js": "^4.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/lib/defenitions/server.define.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { O } from 'ts-toolbelt';
import { QueryAggregateEnum, ServerTypeEnum } from '../enums';
export type ServerType = ServerTypeEnum.MYSQL2 | ServerTypeEnum.MYSQL | ServerTypeEnum.MSSQL | ServerTypeEnum.ORACEL | ServerTypeEnum.POSTGRES | ServerTypeEnum.BETTER_SQLITE | ServerTypeEnum.SQLITE;
export type ServerType = ServerTypeEnum.MYSQL2 | ServerTypeEnum.MYSQL | ServerTypeEnum.MSSQL | ServerTypeEnum.ORACEL | ServerTypeEnum.POSTGRES | ServerTypeEnum.SQLITE;
export type TablesListRow = Record<string, any> & {
table_name: string;
};
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/lib/defenitions/server.define.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/shared/lib/enums/server.enum.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export declare enum ServerTypeEnum {
MYSQL2 = "mysql2",
POSTGRES = "pg",
SQLITE = "sqlite3",
BETTER_SQLITE = "better-sqlite3",
MSSQL = "mssql",
ORACEL = "oracledb"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/lib/enums/server.enum.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/shared/lib/enums/server.enum.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/shared/lib/enums/server.enum.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/shared/src/defenitions/server.define.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export type ServerType =
| ServerTypeEnum.MSSQL
| ServerTypeEnum.ORACEL
| ServerTypeEnum.POSTGRES
| ServerTypeEnum.BETTER_SQLITE
| ServerTypeEnum.SQLITE;

export type TablesListRow = Record<string, any> & {
Expand Down
1 change: 0 additions & 1 deletion packages/shared/src/enums/server.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export enum ServerTypeEnum {
MYSQL2 = 'mysql2',
POSTGRES = 'pg',
SQLITE = 'sqlite3',
BETTER_SQLITE = 'better-sqlite3',
MSSQL = 'mssql',
ORACEL = 'oracledb',
}
Expand Down
1 change: 0 additions & 1 deletion src/main/data/queries/heart-beat.queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ export const heartBeatQueries: Record<ServerType, string> = {
[ServerTypeEnum.POSTGRES]: 'SELECT 1',
[ServerTypeEnum.MSSQL]: 'SELECT 1',
[ServerTypeEnum.SQLITE]: 'SELECT 1',
[ServerTypeEnum.BETTER_SQLITE]: 'SELECT 1',
};
1 change: 0 additions & 1 deletion src/main/services/database.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'better-sqlite3';
import 'reflect-metadata';
import 'sqlite3';
import sqlFormatter from '@sqltools/formatter';
Expand Down
3 changes: 0 additions & 3 deletions src/renderer/components/icons/database-icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ export const DatabaseIcon: FC<DatabaseIconProperties> = ({
case ServerTypeEnum.SQLITE: {
return <Icon {...rest} as={SiSqlite} />;
}
case ServerTypeEnum.BETTER_SQLITE: {
return <Icon {...rest} as={SiSqlite} />;
}
case ServerTypeEnum.POSTGRES: {
return <Icon {...rest} as={SiPostgresql} />;
}
Expand Down
8 changes: 3 additions & 5 deletions src/renderer/defenitions/record-object/account.define.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,11 @@ export const ValidateConnection = Joi.object({
ServerTypeEnum.MYSQL,
ServerTypeEnum.ORACEL,
ServerTypeEnum.POSTGRES,
ServerTypeEnum.SQLITE,
ServerTypeEnum.BETTER_SQLITE,
ServerTypeEnum.SQLITE
)
.required(),
connection: Joi.when(Joi.ref('..client'), {
is: ServerTypeEnum.SQLITE || ServerTypeEnum.BETTER_SQLITE,
is: ServerTypeEnum.SQLITE,
// eslint-disable-next-line unicorn/no-thenable
then: ValidateSqliteConnection.required(),
otherwise: ValidateServerConnection.required(),
Expand All @@ -76,8 +75,7 @@ export const ValidateAccountsWizardStep1 = Joi.object({
ServerTypeEnum.MYSQL,
ServerTypeEnum.ORACEL,
ServerTypeEnum.POSTGRES,
ServerTypeEnum.SQLITE,
ServerTypeEnum.BETTER_SQLITE,
ServerTypeEnum.SQLITE
)
.required(),
connection: Joi.optional(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const AddAccountWizard: FC<AddAccountWizardProperties> = ({

const AccountsWizardConnection = useCallback(
() =>
state.client === ServerTypeEnum.SQLITE || ServerTypeEnum.BETTER_SQLITE ? (
state.client === ServerTypeEnum.SQLITE ? (
<AccountsWizardFileConnection
next={next}
back={back}
Expand Down Expand Up @@ -154,7 +154,7 @@ export const AddAccountWizard: FC<AddAccountWizardProperties> = ({
{
name: 'tunnel',
title: 'SSH Tunnel',
enabled: state.client !== ServerTypeEnum.SQLITE && state.client !== ServerTypeEnum.BETTER_SQLITE,
enabled: state.client !== ServerTypeEnum.SQLITE,
children: (
<AccountsWizardTunnel
initialValue={state.tunnel}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export const AccountsWizardDetails: FC<
{ value: ServerTypeEnum.ORACEL, label: 'Oracel' },
{ value: ServerTypeEnum.POSTGRES, label: 'Postgres' },
{ value: ServerTypeEnum.SQLITE, label: 'SQLite' },
{ value: ServerTypeEnum.BETTER_SQLITE, label: 'Better SQLite' },
]}
strategy="fixed"
colorScheme="primary"
Expand Down
Loading

0 comments on commit 4230295

Please sign in to comment.