Skip to content
This repository was archived by the owner on Apr 28, 2024. It is now read-only.

Commit 2265fc6

Browse files
authored
Merge pull request #111 from slashbaseide/develop
Release v0.8.4
2 parents cb2c23a + 7046477 commit 2265fc6

File tree

10 files changed

+112
-46
lines changed

10 files changed

+112
-46
lines changed

README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,22 @@
3232

3333
# About
3434

35-
Slashbase is open-source modern database IDE for your dev/data workflows. Use Slashbase to connect to any of your database, browse data and schema, write, run and save queries, create charts. Supports MySQL, PostgreSQL and MongoDB.
35+
Slashbase is an open-source modern database IDE for your dev/data workflows. Use Slashbase to connect to any of your database, browse data and schema, write, run and save queries, create charts. Supports MySQL, PostgreSQL and MongoDB.
3636

3737
It is in beta (v0.8), help us make it better by sending your feedback and reach a stable (v1.0) version.
3838
> Star 🌟 & watch 👀 the repository to get updates.
3939
4040
## Features:
4141

42-
- **🧑‍💻 Desktop App**: Use the IDE as standalone desktop app.
42+
- **🧑‍💻 Desktop App**: Use the IDE as a standalone desktop app.
4343
- **🪄 Modern Interface**: With a modern interface, it is easy to use.
4444
- **🪶 Lightweight**: Doesn't take much space on your system.
4545
- **⚡️ Quick Browse**: Quickly filter, sort & browse data and schema with a low-code UI.
46-
- **💾 Save Queries**: Write and Save queries to re-run in future.
46+
- **💾 Save Queries**: Write and Save queries to re-run in the future.
4747
- **📊 Create Charts**: Create charts from your query results.
48-
- **📺 Console**: Run commands like in you do in terminal.
48+
- **📺 Console**: Run commands like you do in the terminal.
4949
- **🗂 Projects**: Organise all database connections into various projects.
50-
- **📕 Query Cheatsheets**: Search and view query commands syntax right inside IDE.
50+
- **📕 Query Cheatsheets**: Search and view query commands syntax right inside the IDE.
5151
- **✅ Database Support**: MySQL, PostgreSQL and MongoDB.
5252

5353
# Installation
@@ -59,8 +59,10 @@ Follow the steps below to download & start the app:
5959
1. Download the [latest release](https://github.com/slashbaseide/slashbase/releases) and extract / open the downloaded file.
6060
2. Follow the platform specific step below
6161
- For Windows, double click the Slashbase file to open the app
62-
- For MacOS, drag the Slashbase file to Applications folder and start the app from launchpad.
63-
- For linux, run `./Slashbase` on terminal to start the app.
62+
- For MacOS, drag the Slashbase file into the Applications folder and start the app from Launchpad.
63+
- For Linux, run `./Slashbase` in the terminal to start the app.
64+
- Requires `libwebkit2gtk-4.0` to be installed.
65+
- On Arch-based distributions, you can install it with `pacman -S webkit2gtk`
6466

6567
## Build from source
6668

@@ -108,18 +110,18 @@ Detailed documentation is available on [slashbase guide](https://slashbase.bip.w
108110

109111
# Community
110112

111-
Join our community on [discord](https://discord.gg/U6fXgm3FAX) and [bip](https://bip.so/slashbase/feed).
113+
Join our community on [Discord](https://discord.gg/U6fXgm3FAX) and [bip](https://bip.so/slashbase/feed).
112114

113115
# Roadmap
114116

115-
### Database Support
117+
## Database Support
116118
- ✅ PostgreSQL Query Engine
117119
- ✅ MongoDB Query Engine
118120
- ✅ MySQL Query Engine
119121
- ☑️ SQLite Query Engine
120122
- ☑️ Redis Query Engine
121123

122-
### Features
124+
## Features
123125
- ✅ Query Cheatsheets
124126
- ☑️ Add/delete Data Models (Table/collections)
125127
- ☑️ Manage Views
@@ -132,7 +134,7 @@ Read our [contribution guide](CONTRIBUTING.md) for getting started on contributi
132134

133135
# Support
134136

135-
If you face any issues installing or using slashbase, send us a mail on slashbaseide@gmail.com or contact support chat on our website [slashbase.com](https://slashbase.com).
137+
If you face any issues installing or using Slashbase, send us a mail to slashbaseide@gmail.com or contact support chat on our website [slashbase.com](https://slashbase.com).
136138

137139
# License
138140

frontend/src/components/dbfragments/console.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ const DBConsoleFragment = ({ }: DBConsolePropType) => {
4646
text: "Start typing command and press enter to run it.\nType 'help' for more info on console.",
4747
cmd: false
4848
}} />
49-
{output.map(block => {
50-
return <OutputBlock block={block} />
49+
{output.map((block, idx) => {
50+
return <OutputBlock block={block} key={idx} />
5151
})}
5252
<PromptInputWithRef onChange={setInput} isActive={currentTab.isActive} nfocus={nfocus} confirmInput={confirmInput} />
5353
<span ref={consoleEndRef}></span>

frontend/src/components/layouts/footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const Footer = (_: FooterPropType) => {
4646
<span>{(isDBConnected !== undefined && isDBConnected) ? "connected" : "not connected"}</span>
4747
</button>)
4848
}
49-
{isDBConnected === true &&
49+
{showStatus && isDBConnected === true &&
5050
(<button className={styles.button + " is-small"} onClick={refreshDataModels}>
5151
<span className="icon is-small">
5252
<i className="fas fa-sync" />

frontend/src/pages/project/newdb.tsx

Lines changed: 57 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ const NewDBPage: FunctionComponent<{}> = () => {
1818
const dispatch = useAppDispatch()
1919
const projects: Project[] = useAppSelector(selectProjects)
2020
const project = projects.find(x => x.id === id)
21-
2221
const [addingError, setAddingError] = useState(false)
2322
const [adding, setAdding] = useState(false)
24-
23+
const [inputError, setInputError] = useState({
24+
error_1: false, error_2: false, error_3: false, error_4: false
25+
})
2526
const [data, setData] = useState({
2627
dbName: "",
2728
dbType: DBConnType.POSTGRES,
@@ -41,8 +42,22 @@ const NewDBPage: FunctionComponent<{}> = () => {
4142

4243
const handleChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>) => {
4344
const type = e.target.type
45+
const name = e.target.name;
4446

45-
const name = e.target.name
47+
switch (name) {
48+
case "dbName":
49+
(e.target.value.trim().length > 0) ? setInputError({ ...inputError, error_1: false }) : setInputError({ ...inputError, error_1: true })
50+
break;
51+
case "dbHost":
52+
(e.target.value.trim().length > 0) ? setInputError({ ...inputError, error_2: false }) : setInputError({ ...inputError, error_2: true })
53+
break;
54+
case "dbPort":
55+
(e.target.value.trim().length > 0) ? setInputError({ ...inputError, error_3: false }) : setInputError({ ...inputError, error_3: true })
56+
break;
57+
case "dbDatabase":
58+
(e.target.value.trim().length > 0) ? setInputError({ ...inputError, error_4: false }) : setInputError({ ...inputError, error_4: true })
59+
break;
60+
}
4661

4762
const value = type === "checkbox"
4863
? (e.target as HTMLInputElement).checked
@@ -81,16 +96,36 @@ const NewDBPage: FunctionComponent<{}> = () => {
8196
sshKeyFile: data.dbSSHKeyFile,
8297
useSSL: data.dbUseSSL,
8398
}
84-
8599
try {
86100
await dispatch(addNewDBConn(payload)).unwrap()
87101
navigate(Constants.APP_PATHS.PROJECT.path.replace('[id]', project.id))
88102
} catch (e: any) {
103+
var f1 = false, f2 = false, f3 = false, f4 = false;
104+
(payload.name.length === 0) ? f1 = true : f1 = false;
105+
(payload.host.length === 0) ? f2 = true : f2 = false;
106+
(payload.port.length === 0) ? f3 = true : f3 = false;
107+
(payload.dbname.length === 0) ? f4 = true : f4 = false;
108+
setInputError({
109+
...inputError,
110+
error_1: f1,
111+
error_2: f2,
112+
error_3: f3,
113+
error_4: f4
114+
})
89115
setAddingError(e)
90116
}
117+
91118
setAdding(false)
92119
}
93120

121+
const normal = {
122+
border: ''
123+
}
124+
125+
const inputStyle = {
126+
border: '1px solid red'
127+
}
128+
94129
return (
95130
<>
96131
<h1>Add new database connection</h1>
@@ -101,12 +136,13 @@ const NewDBPage: FunctionComponent<{}> = () => {
101136
value={data.dbName}
102137
onChange={e => handleChange(e)}
103138
placeholder="Enter a display name for database"
139+
style={inputError.error_1 ? inputStyle : normal}
104140
/>
105141
<div className="field">
106142
<label className="label">Database Type:</label>
107143
<div className="control">
108144
<div className="select">
109-
<select name="dbType" onChange={(e: React.ChangeEvent<HTMLSelectElement>) => { setData((prev) => ({ ...prev, [e.target.name]: e.target.value, dbScheme: "" })) }}>
145+
<select name="dbType" style={normal} onChange={(e: React.ChangeEvent<HTMLSelectElement>) => { setData((prev) => ({ ...prev, [e.target.name]: e.target.value, dbScheme: "" })) }}>
110146
<option value={DBConnType.POSTGRES}>PostgreSQL</option>
111147
<option value={DBConnType.MONGO}>MongoDB</option>
112148
<option value={DBConnType.MYSQL}>MySQL</option>
@@ -118,7 +154,7 @@ const NewDBPage: FunctionComponent<{}> = () => {
118154
<label className="label">Scheme:</label>
119155
<div className="control">
120156
<div className="select">
121-
<select name='dbScheme' onChange={e => handleChange(e)}>
157+
<select name='dbScheme' style={normal} onChange={e => handleChange(e)}>
122158
<option value="default">Select scheme</option>
123159
<option value="mongodb">mongodb</option>
124160
<option value="mongodb+srv">mongodb+srv</option>
@@ -132,34 +168,39 @@ const NewDBPage: FunctionComponent<{}> = () => {
132168
value={data.dbHost}
133169
onChange={e => handleChange(e)}
134170
placeholder="Enter host"
171+
style={inputError.error_2 ? inputStyle : normal}
135172
/>
136173
<InputTextField
137174
label='Port:'
138175
name="dbPort"
139176
value={data.dbPort}
140177
onChange={e => handleChange(e)}
141178
placeholder="Enter Port"
179+
style={inputError.error_3 ? inputStyle : normal}
142180
/>
143181
<InputTextField
144182
label='Database Name:'
145183
name="dbDatabase"
146184
value={data.dbDatabase}
147185
onChange={e => handleChange(e)}
148186
placeholder="Enter Database"
187+
style={inputError.error_4 ? inputStyle : normal}
149188
/>
150189
<InputTextField
151190
label='Database User:'
152191
name="dbUsername"
153192
value={data.dbUsername}
154193
onChange={e => handleChange(e)}
155194
placeholder="Enter Database username"
195+
style={normal}
156196
/>
157197
<PasswordInputField
158198
label='Database Password:'
159199
name='dbPassword'
160200
value={data.dbPassword}
161201
onChange={e => handleChange(e)}
162202
placeholder="Enter database password"
203+
style={normal}
163204
/>
164205
<div className="field">
165206
<label className="label">Use SSH:</label>
@@ -168,9 +209,10 @@ const NewDBPage: FunctionComponent<{}> = () => {
168209
name='dbUseSSH'
169210
value={data.dbUseSSH}
170211
onChange={e => handleChange(e)}
212+
style={normal}
171213
>
172214
<option
173-
value={DBConnectionUseSSHType.NONE}>
215+
value={DBConnectionUseSSHType.NONE} >
174216
None
175217
</option>
176218
<option
@@ -194,7 +236,8 @@ const NewDBPage: FunctionComponent<{}> = () => {
194236
name='dbUseSSL'
195237
type="checkbox"
196238
defaultChecked={false}
197-
onChange={e => handleChange(e)} />
239+
onChange={e => handleChange(e)}
240+
/>
198241
&nbsp;Enable SSL
199242
<span className="help">If you are connecting to database which enforce/require SSL connection. (Example: Azure CosmosDB)</span>
200243
</label>
@@ -208,13 +251,15 @@ const NewDBPage: FunctionComponent<{}> = () => {
208251
value={data.dbSSHHost}
209252
onChange={e => handleChange(e)}
210253
placeholder="Enter SSH Host"
254+
style={normal}
211255
/>
212256
<InputTextField
213257
label='SSH User:'
214258
name="dbSSHUser"
215259
value={data.dbSSHUser}
216260
onChange={e => handleChange(e)}
217261
placeholder="Enter SSH User"
262+
style={normal}
218263
/>
219264
{(data.dbUseSSH === DBConnectionUseSSHType.PASSWORD || data.dbUseSSH === DBConnectionUseSSHType.PASSKEYFILE) &&
220265
<PasswordInputField
@@ -223,6 +268,7 @@ const NewDBPage: FunctionComponent<{}> = () => {
223268
value={data.dbSSHPassword}
224269
onChange={e => handleChange(e)}
225270
placeholder="Enter SSH Password"
271+
style={normal}
226272
/>
227273
}
228274
{(data.dbUseSSH === DBConnectionUseSSHType.KEYFILE || data.dbUseSSH === DBConnectionUseSSHType.PASSKEYFILE) &&
@@ -234,7 +280,9 @@ const NewDBPage: FunctionComponent<{}> = () => {
234280
name='dbSSHKeyFile'
235281
value={data.dbSSHKeyFile}
236282
onChange={e => handleChange(e)}
237-
placeholder="Paste the contents of SSH Identity File here" />
283+
placeholder="Paste the contents of SSH Identity File here"
284+
style={normal}
285+
/>
238286
</div>
239287
</div>
240288
}

frontend/wailsjs/runtime/runtime.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,3 +225,11 @@ export function Hide(): void;
225225
// [Show](https://wails.io/docs/reference/runtime/intro#show)
226226
// Shows the application.
227227
export function Show(): void;
228+
229+
// [ClipboardGetText](https://wails.io/docs/reference/runtime/clipboard#clipboardgettext)
230+
// Returns the current text stored on clipboard
231+
export function ClipboardGetText(): Promise<string>;
232+
233+
// [ClipboardSetText](https://wails.io/docs/reference/runtime/clipboard#clipboardsettext)
234+
// Sets a text on the clipboard
235+
export function ClipboardSetText(text: string): Promise<boolean>;

frontend/wailsjs/runtime/runtime.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@ export function LogFatal(message) {
3737
}
3838

3939
export function EventsOnMultiple(eventName, callback, maxCallbacks) {
40-
window.runtime.EventsOnMultiple(eventName, callback, maxCallbacks);
40+
return window.runtime.EventsOnMultiple(eventName, callback, maxCallbacks);
4141
}
4242

4343
export function EventsOn(eventName, callback) {
44-
EventsOnMultiple(eventName, callback, -1);
44+
return EventsOnMultiple(eventName, callback, -1);
4545
}
4646

4747
export function EventsOff(eventName, ...additionalEventNames) {
4848
return window.runtime.EventsOff(eventName, ...additionalEventNames);
4949
}
5050

5151
export function EventsOnce(eventName, callback) {
52-
EventsOnMultiple(eventName, callback, 1);
52+
return EventsOnMultiple(eventName, callback, 1);
5353
}
5454

5555
export function EventsEmit(eventName) {
@@ -192,3 +192,11 @@ export function Hide() {
192192
export function Show() {
193193
window.runtime.Show();
194194
}
195+
196+
export function ClipboardGetText() {
197+
return window.runtime.ClipboardGetText();
198+
}
199+
200+
export function ClipboardSetText(text) {
201+
return window.runtime.ClipboardSetText(text);
202+
}

go.mod

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ require (
1313
github.com/joho/godotenv v1.4.0
1414
github.com/posthog/posthog-go v0.0.0-20221221115252-24dfed35d71a
1515
github.com/tdewolff/parse/v2 v2.6.5
16-
github.com/wailsapp/wails/v2 v2.3.1
16+
github.com/wailsapp/wails/v2 v2.4.1
1717
github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2
1818
go.mongodb.org/mongo-driver v1.11.1
19-
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa
19+
golang.org/x/crypto v0.1.0
2020
gopkg.in/yaml.v2 v2.4.0
2121
gorm.io/driver/sqlite v1.4.4
2222
gorm.io/gorm v1.24.3
@@ -47,7 +47,6 @@ require (
4747
github.com/golang/protobuf v1.5.0 // indirect
4848
github.com/golang/snappy v0.0.1 // indirect
4949
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
50-
github.com/imdario/mergo v0.3.12 // indirect
5150
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
5251
github.com/jackc/pgconn v1.13.0 // indirect
5352
github.com/jackc/pgio v1.0.0 // indirect
@@ -89,10 +88,10 @@ require (
8988
github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c // indirect
9089
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
9190
golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 // indirect
92-
golang.org/x/net v0.4.0 // indirect
91+
golang.org/x/net v0.7.0 // indirect
9392
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
94-
golang.org/x/sys v0.3.0 // indirect
95-
golang.org/x/text v0.5.0 // indirect
93+
golang.org/x/sys v0.5.0 // indirect
94+
golang.org/x/text v0.7.0 // indirect
9695
google.golang.org/genproto v0.0.0-20200911024640-645f7a48b24f // indirect
9796
google.golang.org/grpc v1.33.1 // indirect
9897
google.golang.org/protobuf v1.28.1 // indirect

0 commit comments

Comments
 (0)