sqlite_rank 0.1.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 64

sqlite_rank #

A dart implementation of the rank function for SQLite FTS4 described in the appendix of the docs.

codecov

Getting Started #

...

[0.1.0] - 2019-05-10

  • Correctly accept bytes returned by SQLite

[0.0.2] - 2019-05-03

  • Stop using async for rank

[0.0.1] - 2019-05-03

  • Initial release

example/main.dart

import 'dart:typed_data';
import 'package:sqlite_rank/sqlite_rank.dart';


/// The SQLite matchinfo function returns a byte array representing 32-bit unsigned integers 
/// in machine byte-order in dart they are mapped to a [Uint8List]
Uint8List matchinfoOne = Uint8List.fromList(
  [1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0]); 
Uint8List matchinfoTwo = Uint8List.fromList(
  [1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0]); 

/// The [rank] function calculates a rank value from the matchinfo array 
final resultOne = rank(matchinfoOne);

/// If you're querying more than one column, you can specify a [columnWeight] weight for each column
final resultTwo = rank(matchinfoTwo, [0.2, 0.7]);

Use this package as a library

1. Depend on it

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


dependencies:
  sqlite_rank: ^0.1.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:sqlite_rank/sqlite_rank.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
28
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
64
Learn more about scoring.

We analyzed this package on Nov 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/to_uint32_list.dart.

Run flutter format to format lib/to_uint32_list.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test