Exhibition-Workflow: Unterschied zwischen den Versionen

Aus Info-Theke
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „= Links = * Exhibition = Workflow = We use the module "Users" as example * create a metadata description: lib/meta/users_meta.dart <source lang="dart"> im…“)
 
Zeile 4: Zeile 4:
= Workflow =
= Workflow =
We use the module "Users" as example
We use the module "Users" as example
* create a metadata description: lib/meta/users_meta.dart
* Create a metadata description: lib/meta/users_meta.dart
<source lang="dart">
<source lang="dart">
import 'module_meta_data.dart';
import 'module_meta_data.dart';
Zeile 28: Zeile 28:
   }
   }
}
}
</source>
* Create some source files: (for example: the module "Users")
<source lang="dart">
# precondition: the current directory is the base folder of the dev-app.
mkdir -p lib/meta/users
meta-tool print-modules Users >lib/meta/modules.dart
meta_tool print-data Users >lib/meta/users/user_data.dart
# show the SQL table definition:
meta_tool print-table
</source>
</source>

Version vom 1. August 2021, 16:21 Uhr

Links

Workflow

We use the module "Users" as example

  • Create a metadata description: lib/meta/users_meta.dart
import 'module_meta_data.dart';

class UserMeta extends ModuleMetaData  {
  static UserMeta instance = UserMeta.internal();
  UserMeta.internal() : super('Users',
    [
      PropertyMetaData('id', DataType.reference, ':primary:', 'combo'),
      PropertyMetaData('name', DataType.string, ':notnull:', '', size: 64),
      PropertyMetaData('displayName', DataType.string, ':unique:notnull:', '', size: 32),
      PropertyMetaData('email', DataType.string, ':unique:notnull:', '', size: 255),
      PropertyMetaData('role', DataType.reference, ':notnull:', ''),
      PropertyMetaData('created', DataType.datetime, '', ''),
      PropertyMetaData('createdBy', DataType.string, '', '', size: 32),
      PropertyMetaData('changed', DataType.datetime, '', ''),
      PropertyMetaData('changedBy', DataType.string, '', '', size: 32),
    ],
    tableName: 'loginusers',
  );
  factory UserMeta(){
    return instance;
  }
}
  • Create some source files: (for example: the module "Users")
# precondition: the current directory is the base folder of the dev-app.
mkdir -p lib/meta/users
meta-tool print-modules Users >lib/meta/modules.dart
meta_tool print-data Users >lib/meta/users/user_data.dart
# show the SQL table definition:
meta_tool print-table