dart-generator

所属分类:Dart语言编程
开发工具:Python
文件大小:0KB
下载次数:0
上传日期:2024-04-05 08:36:51
上 传 者sh-1993
说明:  飞镖发生器
(dart generator)

文件列表:
main.py
structure.json
tablename.txt
tablenameDB.txt
tablenameImpl.txt

Generator for flutter/Dart code base on a json with the structure (exemple is file structure.json) output will be in forlder /busnessObj <- possible change, must be copy only once /busnessObj/gen/ <- business implementation must not be change /databaseObj <- database implementation must not be change prerequisit : - FK must hase the main table name and end with "Id" - PK must be integer autoincrement can be made in the openDB with this code and import 'dart:developer'; ``` db.rawQuery('SELECT * FROM sqlite_master ORDER BY name;').then((tables) { if (tables.length > 0) { String strjson = "{\"tables\":[" ; for (int i = 0; i < tables.length; i++) { String tableName = tables[i]['name'].toString() ; if ((tableName != "sqlite_sequence") && (tableName != "android_metadata")) { db.rawQuery("PRAGMA table_info('$tableName')").then((cols) { db.rawQuery("SELECT count(*) as nb FROM $tableName").then((count) { db.rawQuery("SELECT * FROM $tableName ORDER BY ID ").then((raws){ print("TABLE : $tableName / NB-Raw : "+count[0]['nb'].toString()); print(tables[i]); for (int iraw = 0 ; iraw
近期下载者

相关文件


收藏者