-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Epic/support dynamo db #144
base: master
Are you sure you want to change the base?
Conversation
async saveConnection(connection:Connection) { | ||
try { | ||
if (connection.id) { | ||
const index = this.connections.findIndex(c => c.id === connection.id); | ||
if (index !== -1) { | ||
this.connections[index] = connection; | ||
} | ||
} else { | ||
connection.id = this.connections.length + 1; | ||
this.connections.push(connection); | ||
} | ||
|
||
try { | ||
await storeApi.set('connections', pureObject(this.connections)); | ||
} catch (error) { | ||
console.warn('Failed to persist connections:', error); | ||
} | ||
|
||
return connection; | ||
} catch (error) { | ||
console.error('Error saving connection:', error); | ||
throw error; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
store the type to type like DatabaseType.ELASTICSEARCH to storeApi.set, it should help to simplify the fetchConnections as well?
if (!(error instanceof Error && error.message.includes('__TAURI_IPC__'))) { | ||
if (error instanceof Error) { | ||
message.error(error.message); | ||
} else { | ||
message.error(lang.t('connection.unknownError')); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks worth encapsulating the error inside saveConnection, so On UI page it only needs to care about showing the message ?
try { | ||
await client.send(new ListTablesCommand({})); | ||
return true; | ||
} catch (error) { | ||
if (error instanceof Error) { | ||
throw new Error(error.message); | ||
} | ||
throw new Error('Unknown error occurred while testing connection'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aws-sdk/client-dynamodb should not able to run here, since all ts/vue content running in browser rather than nodejs, so to call the dynamodb,
vue -> rust dynamo lib -> dynamodb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yes! You are right! I will update soon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great, for clusterManage, not need to add support for this pr, I think we can like:
show blank/empty for dyamodb to fix these errors and quick merge,
thanks 🚀 🚀 🚀
feat|fix|refactor: summary title of the PR
Refs: #142