Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Connection = dbConnect("sqlite", "sqlite.db")
- local Table = "Table"
- local HandleQuery = dbQuery(Connection, "CREATE TABLE IF NOT EXISTS " .. Table .. " (Tekst TEXT, ID INTEGER)")
- function Fill_Table()
- local NOW = getTickCount()
- for i = 0, 100 do
- dbQuery(Connection, "INSERT INTO " .. Table .. " (Tekst, ID) VALUES (?, ?)", "Tekst nr" .. i, i)
- end
- local Difference = getTickCount() - NOW
- outputDebugString("Pomyślnie wypełniono tabelę. Czas trwania to " .. Difference .. " milisekund", 1)
- end
- function Show_Table()
- local NOW = getTickCount()
- dbQuery(Connection, "SELECT * FROM " .. Table)
- local Difference = getTickCount() - NOW
- outputDebugString("Pomyślnie wybrano z tabeli. Czas trwania to " .. Difference .. " milisekund", 1)
- end
- addCommandHandler("insert", Fill_Table)
- addCommandHandler("show", Show_Table)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement