extend("sqlite")
extend("string")

demo = sqlite:open([path: "demo1.db"])

sqlite:query([handle: demo, sql: ` 
	DROP TABLE IF EXISTS scores 
  `])

sqlite:query([handle: demo, sql: "CREATE TABLE scores (id INTEGER PRIMARY KEY, player TEXT, score INT)"])
sqlite:query([handle: demo, sql: "INSERT INTO scores (player, score) VALUES (?, ?)", params: ["Al", 10]])
sqlite:query([handle: demo, sql: "INSERT INTO scores (player, score) VALUES (?, ?)", params: ["Bea", 20]])
sqlite:query([handle: demo, sql: "INSERT INTO scores (player, score) VALUES (?, ?)", params: ["Cy", 30]])

results = sqlite:query([handle: demo, sql: "SELECT player, score FROM scores", params: []])
slog(type(results))

slog(results)

