jaguar_query_sqljocky 2.2.4

  • Installing
  • Versions
  • 61


MySQL (sqljocky) adapter for jaguar_query and jaguar_orm


A simple usage example:

import 'dart:async';
import 'package:jaguar_orm_sqljocky/jaguar_orm_sqljocky.dart';

// The model
class Post {

  Post.make(, this.msg,;

  int id;

  String msg;

  String author;

  String toString() => '$id $msg $author';

/// The adapter
SqlJockyAdapter _adapter =
    new SqlJockyAdapter('testing', username: 'root', password: 'dart_jaguar');

/// The bean
class PostBean {
  /// Field DSL for id column
  final IntField id = new IntField('_id');

  /// Field DSL for msg column
  final StrField msg = new StrField('msg');

  /// Field DSL for author column
  final StrField author = new StrField('author');

  /// Table name for the model this bean manages
  String get tableName => 'posts';

  /// Inserts a new post into table
  Future insert(Post post) async {
    InsertStatement inserter = new InsertStatement()..into(tableName);


    await _adapter.insert(inserter);

  /// Updates a post
  Future update(int id, String author) async {
    UpdateStatement updater = new UpdateStatement()..into(tableName);


    await _adapter.update(updater);

  /// Finds one post by [id]
  Future<Post> findOne(int id) async {
    FindStatement updater = new FindStatement()..from(tableName);


    Map map = await _adapter.findOne(updater);

    Post post = new Post(); = map['_id'];
    post.msg = map['msg']; = map['author'];

    return post;

  /// Finds all posts
  Future<List<Post>> findAll() async {
    FindStatement finder = new FindStatement()..from(tableName);

    List<Map> maps = await (await _adapter.find(finder)).toList();

    List<Post> posts = new List<Post>();

    for (Map map in maps) {
      Post post = new Post(); = map['_id'];
      post.msg = map['msg']; = map['author'];


    return posts;

  /// Deletes a post by [id]
  Future delete(int id) async {
    DeleteStatement deleter = new DeleteStatement()..from(tableName);


    await _adapter.delete(deleter);

  /// Deletes all posts
  Future deleteAll() async {
    DeleteStatement deleter = new DeleteStatement()..from(tableName);

    await _adapter.delete(deleter);

main() async {
  // Connect
  await _adapter.connect();

  PostBean bean = new PostBean();

  // Delete all
  await bean.deleteAll();

  // Insert some posts
  await bean.insert(new Post.make(1, 'Whatever 1', 'mark'));
  await bean.insert(new Post.make(2, 'Whatever 2', 'bob'));

  // Find one post
  Post post = await bean.findOne(1);

  // Find all posts
  List<Post> posts = await bean.findAll();

  // Update a post
  await bean.update(1, 'rowling');

  // Check that the post is updated
  post = await bean.findOne(1);

  // Delete some posts
  await bean.delete(1);
  await bean.delete(2);

  // Find a post when none exists
  try {
    post = await bean.findOne(1);
  } on JaguarOrmException catch (e) {

  // Close connection
  await _adapter.close();



  • Initial version, created by Stagehand

Use this package as a library

1. Depend on it

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

  jaguar_query_sqljocky: ^2.2.4

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:

import 'package:jaguar_query_sqljocky/jaguar_query_sqljocky.dart';
Version Uploaded Documentation Archive
2.2.4 Sep 25, 2018 Go to the documentation of jaguar_query_sqljocky 2.2.4 Download jaguar_query_sqljocky 2.2.4 archive
2.2.2 Sep 11, 2018 Go to the documentation of jaguar_query_sqljocky 2.2.2 Download jaguar_query_sqljocky 2.2.2 archive
0.2.2 Jul 12, 2017 Go to the documentation of jaguar_query_sqljocky 0.2.2 Download jaguar_query_sqljocky 0.2.2 archive
0.2.1 Jul 12, 2017 Go to the documentation of jaguar_query_sqljocky 0.2.1 Download jaguar_query_sqljocky 0.2.1 archive
0.2.0 Jul 12, 2017 Go to the documentation of jaguar_query_sqljocky 0.2.0 Download jaguar_query_sqljocky 0.2.0 archive
0.1.0 Jul 12, 2017 Go to the documentation of jaguar_query_sqljocky 0.1.0 Download jaguar_query_sqljocky 0.1.0 archive
0.0.2 Jan 13, 2017 Go to the documentation of jaguar_query_sqljocky 0.0.2 Download jaguar_query_sqljocky 0.0.2 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.1.0
  • pana: 0.12.7


Detected platforms: Flutter, other

Primary library: package:jaguar_query_sqljocky/jaguar_query_sqljocky.dart with components: io.

Maintenance issues and suggestions

Use analysis_options.yaml. (-10 points)

Rename old .analysis_options file to analysis_options.yaml.

Read more about the setup of analysis-options.yaml.

The description is too short. (-20 points)

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

Maintain an example.

None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use jaguar_query_sqljocky.dart. Packages with multiple examples should use example/


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
jaguar_query ^2.2.4 2.2.4
path ^1.6.2 1.6.2
sqljocky5 ^2.2.0 2.2.0
Transitive dependencies
async 2.0.8
charcode 1.1.2
collection 1.14.11
convert 2.0.2
crypto 2.0.6
logging 0.11.3+2
meta 1.1.6
pool 1.3.6
stack_trace 1.9.3
typed_buffer 2.1.1
typed_data 1.1.6
Dev dependencies
test ^1.3.0