access 1.1.1

  • Readme
  • Changelog
  • Installing
  • 63

Access #

A simple database utility for the entity library.

Build Status

Use #

access((access) async {
  await for (final row in access.query('select ...')) {
    ...
  }
  ...
  await access.execute('update...');
})
//transactions ends here; roll back if an uncaught exception is thrown
.catchError((ex, st) {
  ...
});

Who Uses #

  • Quire - a simple, collaborative, multi-level task management tool.
  • Keikai - a sophisticated spreadsheet for big data

Changes #

*1.1.1

  • DBAccess.close() introduced to allow user to force a transaction to close earlier.

1.1.0

  • DBAccess.tag and configure()'s onTag no longer supported.
  • onSlowSql and onPreSlowSql's signatures changed.
  • configure()'s slowSql renamed to slowSqlThreshold.

1.0.6

  • onPreSlowSql introduced to log the information about locks when detecting a slow SQL statement.

1.0.5

  • primaryKey introduced to define a table with multi-column primary key.

1.0.4

  • not() introduced to specify a negative condition in the whereValues condition.

1.0.2

  • Index() supports where for creating a partial index.

0.11.3

  • API of sqlWhereBy is changed -- no option argument

0.11.1

  • Adds the otype argument to UnboundReference() for documentation purpose

0.11.0

  • Use named paramters instead of positional parameters for declaring types
  • The column that Reference() references can be specified.

0.10.1

  • afterComment() and afterRollback() can return an optional Future instance

0.10.0

  • Citext added
  • The signature of the create method is changed.

0.9.10

  • Slow SQL warning logs the previous SQL statement instead if it is commit

0.9.8

  • The signature of the shallLogError argument has been changed.

0.9.7

  • Apply the generic method syntax (so it requires Dart 1.21 or later)

0.9.3

  • DBAccess.rollingback is never null. If null is assigned, false will be stored instead.

0.9.1

  • Support virtual columns

0.9.0

  • Remove DBAccess.after(), and replaced with DBAccess.afterCommit() and DBAccess.afterRollback().
  • DBAccess.rollingback can be set with any value.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  access: ^1.1.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:access/access.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
65
Health:
Code health derived from static analysis. [more]
55
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
63
Learn more about scoring.

We analyzed this package on Oct 23, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, other

Primary library: package:access/access.dart with components: io.

Health suggestions

Fix lib/access.dart. (-25.60 points)

Analysis of lib/access.dart reported 59 hints, including:

line 61 col 13: Don't type annotate initializing formals.

line 77 col 1: Prefer using /// for doc comments.

line 108 col 7: DO use curly braces for all flow control structures.

line 120 col 7: DO use curly braces for all flow control structures.

line 127 col 7: DO use curly braces for all flow control structures.

Fix lib/dbtool.dart. (-19.39 points)

Analysis of lib/dbtool.dart reported 43 hints, including:

line 21 col 1: Prefer using /// for doc comments.

line 33 col 50: Use = to separate a named parameter from its default value.

line 42 col 57: Use = to separate a named parameter from its default value.

line 43 col 39: Use = to separate a named parameter from its default value.

line 74 col 12: Don't type annotate initializing formals.

Fix lib/src/dbtool/dbtool_create.dart. (-7.24 points)

Analysis of lib/src/dbtool/dbtool_create.dart reported 15 hints, including:

line 14 col 5: DO use curly braces for all flow control structures.

line 16 col 5: DO use curly braces for all flow control structures.

line 19 col 5: DO use curly braces for all flow control structures.

line 21 col 5: DO use curly braces for all flow control structures.

line 63 col 16: DO use curly braces for all flow control structures.

Fix lib/src/dbtool/dbtool_purge.dart. (-1 points)

Analysis of lib/src/dbtool/dbtool_purge.dart reported 2 hints:

line 21 col 7: DO use curly braces for all flow control structures.

line 47 col 9: DO use curly braces for all flow control structures.

Maintenance issues and suggestions

Use constrained dependencies. (-20 points)

The pubspec.yaml contains 2 dependencies without version constraints. Specify version ranges for the following dependencies: entity, postgresql2.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and access.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
entity >=0.7.0 1.5.0+1
logging >=0.11.0 <2.0.0 0.11.3+2
postgresql2 >=0.5.0 0.5.2
rikulo_commons >=3.0.0 <4.0.0 3.3.0
Transitive dependencies
charcode 1.1.2
collection 1.14.12
convert 2.1.1
crypto 2.1.3
mime 0.9.6+3
typed_data 1.1.6
Dev dependencies
test any