Skip to content

Is it possible to check/validate a database has the correct schema? #850

Answered by asmith26
asmith26 asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks very much for the information @alextekartik, this gave me the confidence to explore this further - the following seems to be working quite nicely:

class SqliteMasterFields {
  static const String type = 'type';
  static const String name = 'name';
  static const String tbl_name = 'tbl_name';
  static const String rootpage = 'rootpage';
  static const String sql = 'sql';
}

class SqliteMaster {
  final String type;
  final String name;
  final String tbl_name;
  final int rootpage;
  final String sql;

  const SqliteMaster({
    required this.type,
    required this.name,
    required this.tbl_name,
    required this.rootpage,
    required this.sql,
  });

  static SqliteMaster from…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@asmith26
Comment options

@alextekartik
Comment options

Answer selected by asmith26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants