Code Monkey home page Code Monkey logo

sqflite_migration's Introduction

Hi there 👋

My name is Dane Mackier. I am the creator of FilledStacks.

  • 🔭 Over 2.7 million views
  • 🌱 Over 1.1 million blog sessions
  • ⭐️ Over 5.6k stars in github

Become a better Flutter engineer every week, in less then 10 minutes

sqflite_migration's People

Contributors

filledstacks avatar francescopasin avatar hurbes avatar rod86 avatar s6o avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sqflite_migration's Issues

Migration service resetVersion method is not working

Hi

Following code return "Null check operator used on a null value" error

final_ _migrationService = locator<DatabaseMigrationService>();
migrationService.resetVersion();

Due to this I am unable to reset Database version to 0.

Could you please help me out to reset database version. Thanks in advance.

flutter doctor -v
[√] Flutter (Channel stable, 2.5.0, on Microsoft Windows [Version 10.0.19042.1165], locale en-IN)
• Flutter version 2.5.0 at D:\flutter\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 4cc385b4b8 (7 days ago), 2021-09-07 23:01:49 -0700
• Engine revision f0826da7ef
• Dart version 2.14.0

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\Users\shahzad\AppData\Local\Android\Sdk
• Platform android-30, build-tools 30.0.3
• ANDROID_HOME = C:\Users\shahzad\AppData\Local\Android\Sdk
• Java binary at: C:\Program Files\Android\Android Studio1\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at C:\Users\shahzad\AppData\Local\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 4.1)
• Android Studio at C:\Program Files\Android\Android Studio1
• Flutter plugin can be installed from:
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.60.1)
• VS Code at C:\Users\shahzad\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.26.0

[√] Connected device (3 available)
• Moto G 5 Plus (mobile) • ZY223ZS56P • android-arm • Android 8.1.0 (API 27)
• Chrome (web) • chrome • web-javascript • Google Chrome 93.0.4577.63
• Edge (web) • edge • web-javascript • Microsoft Edge 93.0.961.47

• No issues found!

Regards
Muhammed Munees

Support for bool, list and map

I need to save a data model which contains Boolean, List, Map and List is there any provision to save this type of data in database?

If not, are planning todo?

Why not PRAGMA user_version?

The readme says that pragma user_version is not feasible to track the database version because it is inconsistent.

Can you please elaborate why?
Sorry if that is common knowledge but intuitively I would assume that storing the db version in the db is more robust than storing it somewhere else.

Need comments!

It is very important to write comments in *.sql files. Please, enter this feature, because *.sql file might be very big with many queries.
p.s. The service is awesome, thank you!

ability to specify asset path (different from /assets/sql)

Can you please add ability to place SQL files in folder other than "assets/sql/" (this is because we use this folder for something else)

There are two options:

  1. migrationFiles array can have full path - then add option to ignore /assets/sql/ prefix.
  2. like the option databaseVersionKey -- add one more to specify path.

Migrations with "--" in text strings fail

Hi @FilledStacks,
First off, I love all your content! But my query below is failing when using this plugin because it has a string that contains "--". I think

int commentPos = line.indexOf('--');
switch (commentPos) {
case -1:
// no SQL comment, passthrough
accum.add(line);
break;
case 0:
// whole line comment, skip
break;
default:
// otherwhise, an end of line comment
accum.add(line.substring(0, commentPos));
is the problem because it doesn't take situations where "--" might be valid. For example,

CREATE TABLE Assets (
   id             INTEGER   NOT NULL  PRIMARY KEY
  ,filePath       TEXT      NOT NULL
  ,nameSingular   TEXT      NOT NULL
  ,namePlural     TEXT      NOT NULL
  ,sourceUrl      TEXT      NOT NULL
  ,active         INTEGER   NOT NULL  DEFAULT 1
);

INSERT INTO Assets (
   id
  ,filePath
  ,nameSingular
  ,namePlural
  ,sourceUrl
  ,active
) VALUES (
   1
  ,'assets/svg/openclipart.com/francesco_rollandin/Architetto----Dino-08.svg' -- notice the '----' in the path
  ,'Dinosaur'
  ,'Dinosaurs'
  ,'https://openclipart.org/detail/25749/architetto-dino-08'
  ,1
);

This isn't a total deal-breaker in my case because I can just change the filename, but others may run into this issue and be like, AAAAAAAAAHHHHHH!!!!!!

Thanks to everyone at FilledStacks!

Upgrade to GetIt 5.x.x

It would be great if you could upgrade the required GetIt version to the current latest version

null-safety migration?

Hey there,
I am one of a big fan of you!
I think I need to migrate to null-safety, and wanna be with sqflite_migration.
I know it's definetly on you list and that you ve been so busy.
I 'll be waiting here for the update to migrate :)
Thanks a lot!

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.