sqlite-lean

Sqlite3 bindings for lean4 (mirror)

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
import FFI

open IO

def double (f : Nat -> Nat) n := f (f n)
def inc := fun n => n + 1

def main : IO Unit := do
  let conn  Sqlite.connect "test.sqlite3"
  match  Sqlite.exec conn "select 1 + 1 = 2;" with
     | Sqlite.Result.error e => println e
     | Sqlite.Result.ok => println "ok"
     | Sqlite.Result.rows c =>
       match  Sqlite.step c with
        | some s => println s
        | none => println "none"
  println s!"Hello, {conn}"