tableinfo.bmx 693 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. SuperStrict
  2. Framework Database.SQLite
  3. Import BRL.filesystem
  4. Import brl.standardio
  5. Local db:TDBConnection = LoadDatabase("SQLITE", "maxtest.db")
  6. If Not db Then
  7. Print("Didn't work...")
  8. End
  9. End If
  10. If db.hasError() Then
  11. errorAndClose(db)
  12. End If
  13. If db.isOpen() Then
  14. ' get a list of tables in the database
  15. Local table:TDBTable = db.getTableInfo("person", True)
  16. Print table.ddl
  17. ' DebugStop
  18. 'If list Then
  19. ' For Local i:Int = 0 Until list.length
  20. ' DebugLog(" " + (i + 1) + ". " + list[i])
  21. ' Next
  22. 'End If
  23. db.close()
  24. End If
  25. Function errorAndClose(db:TDBConnection)
  26. Print(db.error().toString())
  27. db.close()
  28. End
  29. End Function