mirror of
https://github.com/JezuzLizard/T4SP-Server-Plugin.git
synced 2025-04-20 05:25:44 +00:00
some test
This commit is contained in:
parent
84c212ed2b
commit
64f8dfca8d
1
deps/premake/SQLiteCpp.lua
vendored
1
deps/premake/SQLiteCpp.lua
vendored
@ -22,6 +22,7 @@ function SQLiteCpp.project()
|
||||
|
||||
files {
|
||||
path.join(path.join(SQLiteCpp.source, "src"), "**.cpp"),
|
||||
path.join(path.join(SQLiteCpp.source, "include"), "**.h"),
|
||||
path.join(path.join(SQLiteCpp.source, "sqlite3"), "**.c"),
|
||||
path.join(path.join(SQLiteCpp.source, "sqlite3"), "**.h")
|
||||
}
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include <utils/http.hpp>
|
||||
#include <json.hpp>
|
||||
#include <parser.hpp>
|
||||
#include <SQLiteCpp/Database.h>
|
||||
|
||||
namespace test
|
||||
{
|
||||
@ -46,6 +47,17 @@ namespace test
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
SQLite::Database db("test.db3", SQLite::OPEN_READWRITE|SQLite::OPEN_CREATE);
|
||||
db.exec("CREATE TABLE test (id INTEGER PRIMARY KEY, value TEXT, weight INTEGER)");
|
||||
|
||||
db.exec("INSERT INTO test VALUES (NULL, \"first\", 3)");
|
||||
db.exec("INSERT INTO test VALUES (NULL, \"second\", 5)");
|
||||
db.exec("INSERT INTO test VALUES (NULL, \"third\", 7)");
|
||||
|
||||
printf("%s %s %d\n", db.execAndGet("SELECT value FROM test WHERE id=2").getString().c_str(), db.execAndGet("SELECT value FROM test WHERE weight=7").getString().c_str(), db.execAndGet("SELECT weight FROM test WHERE value=\"first\"").getInt());
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user