fromUrl static method

Future<DartApiDB> fromUrl(
  1. String url, {
  2. PoolConfig? poolConfig,
})

Connects using a 12-factor database URL — pass DATABASE_URL straight through:

final db = await DatabaseFactory.fromUrl(
  Platform.environment['DATABASE_URL']!,
);

See DbConfig.fromUrl for the supported formats.

Implementation

static Future<DartApiDB> fromUrl(String url, {PoolConfig? poolConfig}) =>
    create(DbConfig.fromUrl(url, poolConfig: poolConfig));