1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:47:34 +00:00

SQLServer+SQL+LibSQL: Allow sql client to specify the database name

The database the sql client connected to was 'hardcoded' to the login
name of the calling user.
- Extended the IPC API to be more expressive when connecting, by
returning the name of the database the client connected to in the
'connected' callback.
- Gave the sql client a command line argument (-d/--database) allowing
an alternative database name to be specified

A subsequent commit will have a dot command allowing the user to
connect to different databases from the same sql session.
This commit is contained in:
Jan de Visser 2021-08-26 18:45:37 -04:00 committed by Andreas Kling
parent c5c7a9d198
commit e923cb3739
5 changed files with 18 additions and 10 deletions

View file

@ -43,7 +43,7 @@ DatabaseConnection::DatabaseConnection(String database_name, int client_id)
m_accept_statements = true;
auto client_connection = ClientConnection::client_connection_for(m_client_id);
if (client_connection)
client_connection->async_connected(m_connection_id);
client_connection->async_connected(m_connection_id, m_database_name);
else
warnln("Cannot notify client of database connection. Client disconnected");
});