To use this backend, you must configure the database connection parameters within the PHP script. There are two distinct configuration contexts:
- Application Database (Save/Load): Used for storing and retrieving saved database designs. Configure
setup_saveloadlist() with the credentials for the table where design XML data is stored. - Import Database: Used when importing an existing PostgreSQL database into the designer. Configure
setup_import() with the credentials for the target database you wish to scan.
Important PostgreSQL Notes:
- When prompted for a database name in the UI, enter any value.
- PostgreSQL does not have an 'auto increment' checkbox; instead, use the
serial type for columns. When importing, look for an Integer type with a default value like nextval(...). - User-defined types may not be captured if they are not defined in
../../db/postgresql/datatypes.xml.
// Example configuration for the application's storage
function setup_saveloadlist() {
Define("HOST_ADDR", "localhost");
Define("PORT_NO", "5432");
Define("DATABASE_NAME", "wwwsqldesigner");
Define("USER_NAME", "wwwsqldesigner");
Define("PASSWORD", "xxx");
Define("TABLE", "wwwsqldesigner");
}
// Example configuration for importing an existing database
function setup_import() {
Define("HOST_ADDR", "localhost");
Define("PORT_NO", "5432");
Define("DATABASE_NAME", "testdb");
Define("USER_NAME", "username");
Define("PASSWORD", "??????");
}