Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Dart PostgreSQL driver: supports extended query format, binary protocol and statement reuse.

License

NotificationsYou must be signed in to change notification settings

stablekernel/postgresql-dart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Statuscodecov

A library for connecting to and querying PostgreSQL databases.

This driver uses the more efficient and secure extended query format of the PostgreSQL protocol.

Usage

CreatePostgreSQLConnections andopen them:

var connection=PostgreSQLConnection("localhost",5432,"dart_test", username:"dart", password:"dart");await connection.open();

Execute queries withquery:

List<List<dynamic>> results=await connection.query("SELECT a, b FROM table WHERE a = @aValue", substitutionValues: {"aValue":3});for (final rowin results) {var a= row[0];var b= row[1];}

Return rows as maps containing table and column names:

List<Map<String,Map<String,dynamic>>> results=await connection.mappedResultsQuery("SELECT t.id, t.name, u.name FROM t LEFT OUTER JOIN u ON t.id=u.t_id");for (final rowin results) {var tID= row["t"]["id"];var tName= row["t"]["name"];var uName= row["u"]["name"];}

Execute queries in a transaction:

await connection.transaction((ctx)async {var result=await ctx.query("SELECT id FROM table");await ctx.query("INSERT INTO table (id) VALUES (@a:int4)", substitutionValues: {"a": result.last[0]+1    });});

See the API documentation:https://pub.dev/documentation/postgres/latest/

Features and bugs

Please file feature requests and bugs at theissue tracker.

About

Dart PostgreSQL driver: supports extended query format, binary protocol and statement reuse.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors10


[8]ページ先頭

©2009-2025 Movatter.jp