floor_annotation 0.4.0

Floor #

A supportive SQLite abstraction for your Flutter applications.

Don't import this package! You should be using the floor package, which comes with all the annotations. Separating the packages brings some benefits for developing the library but not for the users of it.

Floor - the bottom layer of a Room.

Bugs and Feedback #

For bugs, questions and discussions please use the Github Issues.

License #

Copyright 2019 Vitus Ortner

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Changelog #

0.4.0 #

  • Add primary key field to @Entity annotation

0.3.1 #

Changes #

  • Revert meta package to version 1.1.6

0.3.0 #

Changes #

  • Use TypeChecker for all annotations
  • Add publishing instructions
  • Remove unused annotation names
  • Simplify the mapping from an entity to a map
  • Fix database writer test
  • Make stream emit query result on subscription
  • Update example to use StreamBuilder
  • Update README

🐛 Bug Fixes #

  • Correct mapper instance name referenced by generated query methods

0.2.0 #

Changes #

  • Add database adapters
  • Run floor Flutter tests
  • Move value objects to value_objects directory
  • Map source elements into value objects in processors
  • Use GeneratorForAnnotation and TypeChecker to verify annotations
  • Throw more specific errors on obfuscated database annotation

🚀 Features #

  • Add support for migrations
  • Add support for returning Streams as query result
  • Support accessing data from Data Access Objects
  • Add entity classes to database annotation
  • Add support for indices

0.1.0 #

🚀 Features #

  • Support conflict strategies when inserting and updating records (#67) @vitusortner
  • Add support for running queries that return void (#61) @vitusortner
  • Add support for foreign keys (#59) @vitusortner
  • Add parameter verification for query methods (#57) @vitusortner
  • Return deleted row count on delete (#53) @vitusortner
  • Return updated rows count on update (#52) @vitusortner
  • Return ID/s of inserted item/s (#51) @vitusortner
  • Add support for transactions (#49) @vitusortner
  • Add support for changing (insert, update, delete) lists (#42) @vitusortner
  • Support custom entity name (#41) @vitusortner
  • Enable NOT NULL columns (#40) @vitusortner
  • Enable custom column name mapping (#39) @vitusortner
  • Add delete methods code generation and fix update methods (#22) @vitusortner
  • Add update methods code generation (#21) @vitusortner
  • Add insert methods code generation (#20) @vitusortner
  • Add code generator for query methods (#17) @vitusortner
  • Code generation for database creation (#13) @vitusortner

Use this package as a library

1. Depend on it

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


dependencies:
  floor_annotation: ^0.4.0

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:floor_annotation/floor_annotation.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
27
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
61
Learn more about scoring.

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

  • Dart: 2.5.0
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:floor_annotation/floor_annotation.dart.

Maintenance suggestions

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 floor_annotation.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.1.0 <3.0.0
meta ^1.1.6 1.1.7