sqllite 1.1.0

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 20

sqllite-dart

A dart wrapper for kipken/sql.js

Usage

    import 'package:sqllite/sqllite.dart';

    main() {
      var db = new Database();
      var statement = """
        CREATE TABLE hello (a int, b char);
        INSERT INTO hello VALUES (0, 'hello');
        INSERT INTO hello VALUES (1, 'world');
      """;
      db.run(statement);
      var res = db.exec("SELECT * FROM hello");
      for (var value in res.first.values) {
        print('row: ${value[0]} ${value[1]}');
      }
    }

Features and bugs

Please file feature requests and bugs at the issue tracker.

Changelog

0.0.1

  • Initial version

1.0.0

  • Publish and add to github

example/main.dart

import 'dart:html';
import 'dart:convert';
import 'dart:typed_data';
import 'package:sqllite/sqllite.dart';

InputElement uploadInput;
Database db;
main() {
  uploadInput = querySelector('#fileupload');
  uploadInput.onChange.listen(importDb);
}

importDb(evt) {
  final files = uploadInput.files;
  if (files.length == 1) {
    final file = files[0];
    final reader = new FileReader();
    reader.onLoadEnd.listen((e) {
      var upload = reader.result.toString().split(',').elementAt(1);
      var dbBytes = BASE64.decode(upload);
      fillDB(dbBytes);
    });
    reader.readAsDataUrl(file);
  }
}

fillDB(List<int> data) {
  db = new Database(new Uint8List.fromList(data));
  var output = db.exec('SELECT * from LIST_ITEM');
  for (var row in output[0].values) {
    print(row);
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  sqllite: ^1.1.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:sqllite/sqllite.dart';
  
Version Uploaded Documentation Archive
1.1.0 Aug 24, 2016 Go to the documentation of sqllite 1.1.0 Download sqllite 1.1.0 archive
1.0.0 Aug 9, 2016 Go to the documentation of sqllite 1.0.0 Download sqllite 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
40
Health:
Code health derived from static analysis. [more]
--
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
--
Overall:
Weighted score of the above. [more]
20
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.

Maintenance issues and suggestions

Running dartdoc failed. (-10 points)

Make sure dartdoc runs without any issues.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <2.0.0