2
0

test_05.bmx 640 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. SuperStrict
  2. Framework Database.PostgreSQL
  3. Import BRL.StandardIO
  4. Local db:TDBConnection = LoadDatabase("POSTGRESQL", "maxtest", "localhost", 0, "user", "pass")
  5. If Not db Then
  6. Print "Didn't work..."
  7. End
  8. End If
  9. If db.hasError() Then
  10. errorAndClose(db)
  11. End If
  12. If db.isOpen() Then
  13. ' get a list of tables in the database
  14. Local list:String[] = db.getTables()
  15. If list Then
  16. For Local i:Int = 0 Until list.length
  17. Print " " + (i + 1) + ". " + list[i]
  18. Next
  19. End If
  20. db.close()
  21. End If
  22. Function errorAndClose(db:TDBConnection)
  23. Print db.error().toString()
  24. db.close()
  25. End
  26. End Function