24.10.2015, 16:59
Added in v2.0 - Transactions:
Example code:
PHP Code:
SL::Begin(DB:database = DB:1)
SL::Commit(DB:database = DB:1)
PHP Code:
new DB:MyDB;
main()
{
MyDB = SL::Connect("test.db");
new handle = SL::Open(SL::CREATE, "example", "", -1, MyDB);
SL::AddTableEntry(handle, "fooA", SL_TYPE_INT, 11, true);
SL::AddTableEntry(handle, "fooB", SL_TYPE_VCHAR, 24);
SL::AddTableEntry(handle, "fooC", SL_TYPE_FLOAT);
SL::Close(handle);
SL::Begin(MyDB);
for(new i; i != 10000; i++)
{
handle = SL::Open(SL::INSERT, "example", "", -1, MyDB);
SL::WriteString(handle, "fooB", "SomeB");
SL::WriteFloat(handle, "fooC", 0.0);
SL::Close(handle);
}
SL::Commit(MyDB);
}