Skip to content

Latest commit

 

History

History
 
 

sqlite

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Github Actions CI

Overview

Provides an adapter for using the package database with SQLite. The implementation uses the package sqflite.

Links

Getting started

1.Add dependency

dependencies:
  database: any
  database_adapter_sqlite: any

2.Configure

import 'package:database/database.dart';
import 'package:database/sql.dart';
import 'package:database_adapter_sqlite/database_adapter_sqlite.dart';

Future main() async {
  final config = SQLite(
    path: 'path/to/database.db',
  );

  final sqlClient = config.database().sqlClient;

  final result = await database.querySql('SELECT name FROM employee').toRows();
  for (var row in result.rows) {
    print('Name: ${row[0]}');
  }
}