owl_codegen 0.4.0+1

  • Readme
  • Changelog
  • Installing
  • 24

Owl source code generator #

Source code generator for JSON serialization, HTTP APIs and SQL CRUD.

Usage #

A simple usage example can be found in the example project.

Warning: pre-1.0 API is subject to change. Please contact the contributors if you need migration path for early versions.

Changelog #

0.4.0+1 #

  • Fix DateTime parser.

0.4.0 #

  • Upgraded to Dart 2 only.
  • Breaking change: package:postgresql is replaced by package:postgres.

0.3.0 #

  • Updated to Dart 2.

0.2.4 #

  • Use lowercase JSON and UTF8 from dart:convert.

0.2.3 #

  • Support annotated getters and setters for JSON generator.
  • Fixed analysis_options.yaml.
  • Upgrade dependencies.
  • Suppress strong-mode warnings in generated code.

0.2.2 #

  • Upgrade dependencies (build, build_runner and source_gen).

0.2.1+2 #

  • Bugfix: exclude final or setter-only fields (e.g. hashCode).

0.2.1+1 #

  • Bugfix in SQL: Table.create's ifNotExists should propagate schema and table.

0.2.1 #

  • Added missing SQL type mapping.
  • Add support for table name overrides (both for CRUD and for DDL).

0.2.0 #

  • Added support for Postgresql schema prefixes (both for CRUD and for DDL).
  • Better support for foreign key names, deterministically generating one if absent (it is a breaking change if you relied on the default behavior previously).
  • DDL supports adding new columns incrementally. (Deleting columns should be the role of the database operator.)

Use this package as a library

1. Depend on it

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


dependencies:
  owl_codegen: ^0.4.0+1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:owl_codegen/ext/id.dart';
import 'package:owl_codegen/config.dart';
import 'package:owl_codegen/http_generator.dart';
import 'package:owl_codegen/json_generator.dart';
import 'package:owl_codegen/sql_generator.dart';
import 'package:owl_codegen/utils.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
2
Health:
Code health derived from static analysis. [more]
68
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
12
Overall:
Weighted score of the above. [more]
24
Learn more about scoring.

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

  • Dart: 2.6.1
  • pana: 0.13.1+4

Health suggestions

Fix lib/ext/id.dart. (-11.78 points)

Analysis of lib/ext/id.dart reported 25 hints, including:

line 21 col 14: The declaration '_logger' isn't referenced.

line 21 col 24: Unnecessary new keyword.

line 51 col 13: Unnecessary new keyword.

line 54 col 13: Unnecessary new keyword.

line 62 col 45: Unnecessary new keyword.

Fix lib/sql_generator.dart. (-8.17 points)

Analysis of lib/sql_generator.dart reported 17 hints, including:

line 25 col 31: Unnecessary new keyword.

line 52 col 10: Prefer to use whereType on iterable.

line 58 col 9: Unnecessary new keyword.

line 60 col 9: Unnecessary new keyword.

line 160 col 21: Unnecessary new keyword.

Fix bin/main.dart. (-5.84 points)

Analysis of bin/main.dart reported 12 hints, including:

line 20 col 7: Unnecessary new keyword.

line 20 col 26: Unnecessary new keyword.

line 22 col 20: Unnecessary new keyword.

line 28 col 11: Unnecessary new keyword.

line 28 col 30: Unnecessary new keyword.

Fix additional 4 files with analysis or formatting issues. (-10.81 points)

Additional issues in the following files:

  • lib/http_generator.dart (12 hints)
  • lib/utils.dart (5 hints)
  • lib/config.dart (3 hints)
  • lib/json_generator.dart (2 hints)

Maintenance issues and suggestions

Support latest dependencies. (-50 points)

The version constraint in pubspec.yaml does not support the latest published versions for 5 dependencies (analyzer, build, build_runner, quiver, source_gen).

Package is getting outdated. (-27.67 points)

The package was last published 66 weeks ago.

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 owl_codegen.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
analyzer ^0.32.3 0.32.6 0.39.2+1
args ^1.3.0 1.5.2
build ^0.12.0 0.12.7+3 1.2.2
build_runner ^0.9.1 0.9.2 1.7.2
owl ^0.4.0 0.4.0
quiver ^0.29.0 0.29.0+2 2.1.2+1
source_gen ^0.8.3 0.8.3+1 0.9.4+6
yaml ^2.1.12 2.2.0
Transitive dependencies
async 2.4.0
build_config 0.3.2 0.4.1+1
build_resolvers 0.2.2+7 1.3.0
build_runner_core 0.2.2+2 4.3.0
built_collection 4.3.0
built_value 7.0.0
charcode 1.1.2
cli_util 0.1.3+2
code_builder 3.2.1
collection 1.14.12
convert 2.1.1
crypto 2.1.4
csslib 0.16.1
dart2_constant 1.0.2+dart2
dart_style 1.1.3 1.3.3
fixnum 0.10.11
front_end 0.1.4+2 0.1.29
glob 1.2.0
graphs 0.1.3+1 0.2.0
html 0.14.0+3
http_multi_server 2.1.0
http_parser 3.1.3
io 0.3.3
js 0.6.1+1
json_annotation 1.2.0 3.0.0
kernel 0.3.4+2 0.3.29
logging 0.11.3+2
matcher 0.12.6
meta 1.1.8
mime 0.9.6+3
node_interop 1.0.3
node_io 1.0.1+2
package_config 1.1.0
path 1.6.4
pedantic 1.9.0
plugin 0.2.0+3
pool 1.4.0
postgres 1.0.2 2.1.0
pub_semver 1.4.2
pubspec_parse 0.1.4 0.1.5
shelf 0.7.5
source_span 1.5.5
stack_trace 1.9.3
stream_channel 2.0.0
stream_transform 0.0.20 1.1.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
watcher 0.9.7+13