mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:27:35 +00:00
LibSQL+SQLServer+SQLStudio+sql: Propagate connection errors immediately
Currently, when clients connect to SQL server, we inform them of any errors opening the database via an asynchronous IPC. But we already know about these errors before returning from the connect() IPC, so this roundabout propagation is a bit unnecessary. Now if we fail to open the database, we will simply not send back a valid connection ID. Disconnect has a similar story. Rather than disconnecting and invoking an asynchronous IPC to inform the client of the disconnect, make the disconnect() IPC synchronous (because all it does is remove the database from the map of open databases). Further, the only user of this command is the SQL REPL when it wants to connect to a different database, so it makes sense to block it. This did require moving a bit of logic around in the REPL to accommodate this change.
This commit is contained in:
parent
aec75d749a
commit
f9d23e1d2f
10 changed files with 57 additions and 117 deletions
|
@ -2,11 +2,8 @@
|
|||
|
||||
endpoint SQLClient
|
||||
{
|
||||
connected(u64 connection_id, DeprecatedString connected_to_database) =|
|
||||
connection_error(u64 connection_id, SQL::SQLErrorCode code, DeprecatedString message) =|
|
||||
execution_success(u64 statement_id, u64 execution_id, bool has_results, size_t created, size_t updated, size_t deleted) =|
|
||||
next_result(u64 statement_id, u64 execution_id, Vector<DeprecatedString> row) =|
|
||||
results_exhausted(u64 statement_id, u64 execution_id, size_t total_rows) =|
|
||||
execution_error(u64 statement_id, u64 execution_id, SQL::SQLErrorCode code, DeprecatedString message) =|
|
||||
disconnected(u64 connection_id) =|
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue