PostgreSQL support is provided by way of package:angel_orm_postgres.The PostgreSQLExecutor implements QueryExecutor, and takes care ofrunning prepared queries, and passing values to the database server.

    angel init projects using the ORM include helpers like this to load appconfiguration into a database connection:

    1. Future<void> configureServer(Angel app) async {
    2. var connection = await connectToPostgres(app.configuration);
    3. await connection.open();
    4. app
    5. ..container.registerSingleton<QueryExecutor>(PostgreSQLExecutor(connection))
    6. ..shutdownHooks.add((_) => connection.close());
    7. }
    8. Future<PostgreSQLConnection> connectToPostgres(Map configuration) async {
    9. var postgresConfig = configuration['postgres'] as Map ?? {};
    10. var connection = PostgreSQLConnection(
    11. postgresConfig['host'] as String ?? 'localhost',
    12. postgresConfig['port'] as int ?? 5432,
    13. postgresConfig['database_name'] as String ??
    14. Platform.environment['USER'] ??
    15. Platform.environment['USERNAME'],
    16. username: postgresConfig['username'] as String,
    17. password: postgresConfig['password'] as String,
    18. timeZone: postgresConfig['time_zone'] as String ?? 'UTC',
    19. timeoutInSeconds: postgresConfig['timeout_in_seconds'] as int ?? 30,
    20. useSSL: postgresConfig['use_ssl'] as bool ?? false);
    21. return connection;

    Typically, you’ll want to use app configuration to create the connection,rather than hard coding values.