| 80 | } |
| 81 | |
| 82 | Result<Connection> Connection::Reopen( |
| 83 | const Connection& connection, OpenMode mode, ThreadMode threadMode) |
| 84 | { |
| 85 | if (!connection.IsOpen()) |
| 86 | return Error(SQLITE_MISUSE); |
| 87 | |
| 88 | auto path = connection.GetPath(); |
| 89 | |
| 90 | // For memory and temporary databases, the path is empty. |
| 91 | if (path.empty()) |
| 92 | return Error(SQLITE_MISUSE); |
| 93 | |
| 94 | return Open(path, mode, threadMode); |
| 95 | } |
| 96 | |
| 97 | Result<Connection> |
| 98 | Connection::Reopen(sqlite3* connection, OpenMode mode, ThreadMode threadMode) |