sqllite 1.1.0

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

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);
  }
}

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

Analysis

We analyzed this package on Apr 23, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.49.0
  • pana: 0.10.6

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
27 / 100
Health:
Code health derived from static analysis. [more]
96 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
34 / 100
Overall score:
Weighted score of the above. [more]
49
Learn more about scoring.

Platforms

Detected platforms: web, other

Primary library: package:sqllite/sqllite.dart with components: js.

Suggestions

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 1 hint.

    Run dartfmt to format lib/sqllite.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <2.0.0
js ^0.6.0 0.6.1
resource ^1.1.0 1.1.0 2.1.2
Transitive dependencies
typed_data 1.1.5
Dev dependencies
browser ^0.10.0
test ^0.12.0