I'm creating what is, effectively for the sake of this explanation, a server that receives connections which call out to an SQL database (for authentication purposes, obvi.).
DatabaseConnection::DatabaseConnection(const std::string databaseName)
: m_connection(databaseName, SQLite::OPEN_READWRITE|SQLite::OPEN_CREATE),
was first "./test.db" and
CREATE TABLE IF NOT EXISTS login(username TEXT PRIMARY KEY, password TEXT);
. I then deleted the database (it was getting messy with testing), and was just expecting that upon rebooting the server, the database would be re-created and re-seeded with the appropriate table
, but I promptly received this error:
SQLite::Exception: no such table: login
and the server shut down and the connection closed immediately. The database file WAS created, but when I inspect it with SQL on the command line, the table was never created.
I did some Googling and I couldn't find a definitive answer, but I suspect it's either something as simple as my query being incorrect (tested on raw SQL on command line and works), or some sort of caching issue/file path issue.
Any help would be greatly appreciated,