hhtokpinar / sqfEntity

SqfEntity ORM for Flutter/Dart lets you build and execute SQL commands on SQLite database easily and quickly with the help of fluent methods similar to .Net Entity Framework. SqfEntity also generates add/edit forms with validations and special controls (DropDown List, DateTime pickers, Checkboxes.. etc) for your table.
378 stars 100 forks source link

error in many to many insert after update sqfentity_gen to 2.2.0+7 #259

Open master11641 opened 2 years ago

master11641 commented 2 years ago

I use sqfentity_gen: 2.1.2+4 in my project and after update this package, model.g.dart some Errors occurred for example Undefined name 'whereString'. so for SearchCriteria after run flutter pub run build_runner build --delete-conflicting-outputs errors clear but occurred errors in run time i have many to many relationship between two tables like tblProgram and tblpartition and define this relationship in tblpartiotion like this SqfEntityFieldRelationship( relationType: RelationType.MANY_TO_MANY, parentTable: tblProgram, fieldName: 'partitionProgram', manyToManyTableName: 'partitionProgram', deleteRule: DeleteRule.NO_ACTION, ),

and for insert row to this table await PartitionProgram.saveAll([ PartitionProgram(partitionTblId: part.id!, programTblId: temp!)

before with previous version sqfentity_gen: 2.1.2+4 this line has no error in run time but after update to 2.2.0+7 occurred this error E/flutter (15125): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: DatabaseException(near ")": syntax error: , while compiling: INSERT INTO partitionProgram ( partitionTblId, programTblId) VALUES ()) sql 'INSERT INTO partitionProgram ( partitionTblId, programTblId) VALUES ()' args [2, 7]

what is my wrong ? thanks for your help

hhtokpinar commented 2 years ago

The sample DB chinook.db model has a many-to-many related table in this package and works. Can you compare it with your model?

hhtokpinar commented 2 years ago

Sorry, after the last release It's possible. I'll check it out again

hhtokpinar commented 2 years ago

pls try again with the latest version of sqfentity_gen: 2.2.0+8