justinlettau / sqflite_ext

Useful utilities to augment sqflite.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pub CI

sqflite_ext

Useful utilities to augment sqflite. Designed to be unobtrusive helpers, so you still access sqflite directly (not a wrapper).

Usage

Bool utilities

Sqflite does not support the bool type (reference).

import 'package:sqflite_ext/sqflite_ext.dart';

boolToInt(true);
// => 1

boolToIntOrNull(null);
// => null

intToBool(1);
// => true

intToBoolOrNull(null);
// => null

Named arguments

import 'package:sqflite_ext/sqflite_ext.dart';

final result = parseNamedArgs(
  'SELECT * FROM demo WHERE id = :id',
  {'id': 83},
);
// result.query => 'SELECT * FROM demo WHERE id = ?'
// result.arguments => [83]

About

Useful utilities to augment sqflite.

License:MIT License


Languages

Language:Dart 100.0%