postgres_builder 0.3.0 copy "postgres_builder: ^0.3.0" to clipboard
postgres_builder: ^0.3.0 copied to clipboard

A tool designed to make writing PostgreSQL statements easier without writing them by hand.

Postgres Builder #

pub package ci coverage style: very good analysis License: MIT Powered by Mason

A tool designed to make writing SQL statements easier.

Usage #

To start, create an instance of PostgresBuilder to run your queries. There is an included PgPoolPostgresBuilder that uses the postgres_pool package, but you can create your own by extending PostgresBuilder.

To create SQL strings, create Statements, one of

  • Select
  • Insert
  • Update
  • Delete
  • Upsert (insert unless the entity already exists, then update)

Available Methods #

  • execute: run a statement and return nothing back
  • query: run a query an get all the rows back as Map<String, dynamic>
  • singleQuery: run a query and get a single row back as Map<String, dynamic>
  • mappedQuery: run a query and get back rows parsed using your provided fromJson function
  • mappedSingleQuery: run a query and get a single row parsed using your provided fromJson function

Raw Queries #

For all available methods, just add raw to the name to pass in a raw SQL string instead of a Statement.

1
likes
0
points
151
downloads

Publisher

unverified uploader

Weekly Downloads

A tool designed to make writing PostgreSQL statements easier without writing them by hand.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

json_annotation, meta, postgres, postgres_pool, recase

More

Packages that depend on postgres_builder