()
| 41 | |
| 42 | /// Load credentials from a file and connect to the database. |
| 43 | DbConnection ConnectToDB() |
| 44 | { |
| 45 | DbConnection? conn = null; |
| 46 | conn = DbConnection.Builder() |
| 47 | .WithUri(HOST) |
| 48 | .WithDatabaseName(DB_NAME) |
| 49 | .WithToken(AuthToken.Token) |
| 50 | .OnConnect(OnConnected) |
| 51 | .OnConnectError(OnConnectError) |
| 52 | .OnDisconnect(OnDisconnected) |
| 53 | .Build(); |
| 54 | return conn; |
| 55 | } |
| 56 | |
| 57 | /// Our `OnConnect` callback: save our credentials to a file. |
| 58 | void OnConnected(DbConnection conn, Identity identity, string authToken) |
no test coverage detected
searching dependent graphs…