sqflitecon 1.1.0 sqflitecon: ^1.1.0 copied to clipboard
An interface for manage sqflite connections.
sqflitecon #
An interface for manage sqflite connections.
Usage #
Setting up #
- Make sure you are using flutter_dotenv right.
- Include the
DATABASE_PATH
variable to your.env
file with the path of your sqflite database.
Getting connection #
To get a connection instance you can use:
import 'package:sqflitecon/db.dart';
final connection = await DB.getConnetion();
Or just:
import 'package:sqflitecon/db.dart';
final connection = await databaseConnection();
In either case you can enter the same named parameters - like version
, onConfigure
- provided by sqflite (see here). An example below.
import 'package:sqflitecon/db.dart';
final connection = await databaseConnection(
version: 1,
onConfigure: onConfigure);