diff --git a/angel_orm_generator/lib/src/builder/orm/lib_core.dart b/angel_orm_generator/lib/src/builder/orm/lib_core.dart deleted file mode 100644 index 254d3678..00000000 --- a/angel_orm_generator/lib/src/builder/orm/lib_core.dart +++ /dev/null @@ -1,5 +0,0 @@ -import 'package:code_builder/code_builder.dart'; - -final TypeReference $void = new TypeReference((b) => b.symbol = 'void'); - -final Expression override = new CodeExpression(new Code('override')); \ No newline at end of file diff --git a/angel_orm_generator/lib/src/readers.dart b/angel_orm_generator/lib/src/readers.dart new file mode 100644 index 00000000..bba74bd4 --- /dev/null +++ b/angel_orm_generator/lib/src/readers.dart @@ -0,0 +1,19 @@ +import 'package:analyzer/dart/constant/value.dart'; +import 'package:angel_orm/angel_orm.dart'; +import 'package:source_gen/source_gen.dart'; + +ORM reviveORMAnnotation(ConstantReader reader) { + return ORM(reader.peek('tableName')?.stringValue); +} + +class ColumnReader { + final ConstantReader reader; + + ColumnReader(this.reader); + + bool get isNullable => reader.peek('isNullable')?.boolValue ?? true; + + int get length => reader.peek('length')?.intValue; + + DartObject get defaultValue => reader.peek('defaultValue')?.objectValue; +}