database_adapter_postgre 0.2.0 database_adapter_postgre: ^0.2.0 copied to clipboard
An adapter for using 'package:database' API with a PostgreSQL database.
import 'package:database_adapter_postgre/database_adapter_postgre.dart';
Future main() async {
final database = Postgre(
host: 'localhost',
port: 5432,
user: 'your username',
password: 'your password',
databaseName: 'example',
).database();
final iterator = await database.sqlClient
.query(
'SELECT (name) FROM employee',
)
.getIterator();
for (var row in await iterator.toRows()) {
print('Name: ${row[0]}');
}
}