Coder Social home page Coder Social logo

Comments (8)

hhtokpinar avatar hhtokpinar commented on July 18, 2024 1

in the next version (0.2.6) you can make..

from sqfentity.

majdkz97 avatar majdkz97 commented on July 18, 2024

thank you
When you expect the new version to be released
Sorry, but i'm Working project and string id is Very important to me.

from sqfentity.

hhtokpinar avatar hhtokpinar commented on July 18, 2024

Please update your version to 0.2.6
and you may add this property into your table model

primaryKeyType = PrimaryKeyType.text

and remove this line (if exists):

primaryKeyIsIdentity = true // (old version)

from sqfentity.

majdkz97 avatar majdkz97 commented on July 18, 2024

thanks for your effort
but it's not working
code:
await Users(id:'stringId',name: 'a1').save();
Error:
E/SQLiteLog( 8534): (20) statement aborts at 5: [INSERT OR REPLACE INTO users (id, userId,name,img,shortName,status,lastSeen,emails,isDeleted) VALUES (?,?,?,?,?,?,?,?,?)] datatype mismatch

from sqfentity.

hhtokpinar avatar hhtokpinar commented on July 18, 2024

I have tested this on ToDo table and it's worked.. can you send me your table model please?


  final td2 = Todos2();
  td2.id = "5d4c006c089eab33022cb432";
  td2.title = "test";
  var res = await td2.save();
  print(res.toString());
  // sample 2
  td2.id = "5d4c006c089eab33022cb433";
  td2.title = "test2";
  res = await td2.save();
  print(res.toString());

  td2.id = "5d4c006c089eab33022cb434";
  td2.title = "test3";
  res = await td2.saveAs();
  print(res.toString());

  final tdList = await Todos2().select().toList();
  for (var td in tdList) {
    print(td.toMap());
  }

  // getbyId sample 
  final td3 = await Todos2().getById("5d4c006c089eab33022cb434");
  print(td3.toMap());

and results:


I/flutter ( 3614): {id: 5d4c006c089eab33022cb434, title: test3, completed: false}
I/flutter ( 3614): {id: 5d4c006c089eab33022cb432, title: test, completed: false}
I/flutter ( 3614): {id: 5d4c006c089eab33022cb433, title: test2, completed: false}
I/flutter ( 3614): {id: 5d4c006c089eab33022cb434, title: test3, completed: false}

from sqfentity.

majdkz97 avatar majdkz97 commented on July 18, 2024

Did you edit your sqflite Library?
i think my proplem in sqflite library

from sqfentity.

hhtokpinar avatar hhtokpinar commented on July 18, 2024

Please remember that you have to re-generate model if you make changes on table or db model

from sqfentity.

hhtokpinar avatar hhtokpinar commented on July 18, 2024

@majdkz97 did you re-generate after modifying the model?

Please remember that you have to re-generate model if you make changes on table or db model

from sqfentity.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.