Here’s another of my permanent reminder web sticky notes, covering how to set up a PostgreSQL database for Blitzmax in Windows.
• Your windows file system needs to be NTFS
• Download the latest PostgreSQL installer package
• Jump to this installer walk-through page
• Step through the walk-through. Choose the defaults in most cases. Make sure you write down all your settings!
My settings were:
Account name: postgres
domain: DAVIDDECAND6915
pass: account_sql_pass
port: 5432
UTF8 encoding for server and client
Localhost connections only (no remote connections)
superuser name: superuser_name
pass: superuser_pass
• Navigate to Control Panel/System/Advanced/Environment Variables and add the PostgreSQL bin location to the end of your PATH. Mine looked like this: ;C:\Program Files\PostgreSQL\8.3\bin
• Download Brucey’s BAH.Database and BAH.dbpostgreSQL.mod
• Place them in the folder as such: Blitzmax/mod/bah.mod/database.mod and Blitzmax/mod/bah.mod/dbpostgresql.mod
• Navigate to BlitzMax\mod\bah.mod\dbpostgresql.mod\lib and copy libpg.a and paste it in BlitzMax\lib
• Restart Windows to let the environment variables PATH settings take effect
• Load up and run the test files in BlitzMax\mod\bah.mod\dbpostgresql.mod\tests
• Edit the LoadDatabase call with your own databae specifics. My LoadDatabase call looked like this:
Local db:TDBConnection = LoadDatabase("POSTGRESQL", "postgres", "localhost", 5432, "superuser_name", "superuser_pass")
• Ctrl-D in Blitzmax to compile the new modules and then Compile and run the test.bmx file.
• If all is well, it should spit out something like:
DebugLog:1. Name = Alfred Aho
DebugLog: 2. Name = Brian Kernighan
DebugLog:3. Name = Peter Weinberger
NOTICE: CREATE TABLE/PRIMARY KEY well create implicit index "person_pkey" for table "person"
Entries (RSS)