Giter Site home page Giter Site logo

dart-sqlite's People

Contributors

pylaligand avatar sam-mccall avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dart-sqlite's Issues

I fear I'm doing something stupid...

My pubspec.yaml looks like this:

name: sqlite_test
version: 0.0.1
description: A simple console application.
dependencies:
  sqlite: ^0.3.0

My main.dart looks like this:

import 'package:sqlite/sqlite.dart';

main(List<String> args) async {
  final db = new Database.inMemory();

  Row row =
      await db.query('SELECT ?+16, UPPER(?)', params: [2000, 'Ligue 1']).first;
  final int year = row[0];
  final String league = row[1];
  print('-- $league $year --');
}

And yet, running it fails like this:

$ pub run bin/main.dart
Unhandled exception:
Class 'Database' has no instance method 'query'.

NoSuchMethodError: method not found: 'query'
Receiver: Instance of 'Database'
Arguments: ["SELECT ?+16, UPPER(?)", params: Instance(length:2) of '_GrowableList']
#0      Object._noSuchMethod (dart:core-patch/object_patch.dart:42)
#1      Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
#2      main.<main_async_body> (file:///Users/brett/dart-projects/sqlite-test/bin/main.dart:7:16)
#3      Future.Future.microtask.<anonymous closure> (dart:async/future.dart:144)
#4      _microtaskLoop (dart:async/schedule_microtask.dart:41)
#5      _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)
#6      _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)
#7      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:149)

Halp?

Dart 2 support?

Hi,

Just wondering if there are any plans on updating this package to support Dart version 2?

We are developing a Flutter app and are making use of the sqflite package, however testing is complicated by the device OS dependency e.g. only supports on Android or iOS.

Ideally we'd like to be able to utilise this package to construct a specialised Sqlite DB interface for non-device environments but benefit from the common underlying SQL syntax and record changes. Use of Mockito not sufficient.

Hope the above makes sense as to use-case.

thx

How to proper close database? after colse statement still exists

im on
ubuntu 16.04
dart sdk 1.19
sqlite 0.4.0

  1. I do
    ...
    var db = new sqlite.Database("pathtosqlite")
    ...
  2. I get a database connection and pass it through some functions
    ...
    var x = await doStuff(db); (doing several db.query() calls)
    db.close()
    ...

but then I always get an error saying

...
Warning: sqlite.Database.close(): 2 statements still open.
finished with exit code 139 (interrupted by signal 11: SIGSEGV)
...

any tips on what Im doing wrong?

SqliteException: Dart buffer was too small

Unhandled exception:
SqliteException: Dart buffer was too small
#0      bindValues (package:sqlite/src/native.dart:36:71)
#1      Request.query (package:sqlite/src/request.dart:106:7)
#2      Request.execute (package:sqlite/src/request.dart:115:12)
#3      Database.execute (package:sqlite/sqlite.dart:70:50)

Build failed.

:~/tmp/dart-sqlite$ ./build.sh

g++ -O2 -DDART_SHARED_LIB -I/home/biggenius/dart-sdk/include -rdynamic -fPIC -shared src/dart_sqlite.cc -lsqlite3 -o lib/libdart_sqlite.so
src/dart_sqlite.cc: In function ‘Dart_Handle* dart_sqlite_Init(Dart_Handle)’:
src/dart_sqlite.cc:34:79: error: invalid conversion from ‘void (* (
)(Dart_Handle, int))(Dart_NativeArguments) {aka void (_ ()(Dart_Handle, int))(Dart_NativeArguments)}’ to ‘Dart_NativeEntryResolver {aka void ( ()(Dart_Handle, int, bool))(Dart_NativeArguments)}’ [-fpermissive]
In file included from src/dart_sqlite.cc:8:0:
src/dart_api.h:2244:25: error: initializing argument 2 of ‘Dart_Handle* Dart_SetNativeResolver(Dart_Handle, Dart_NativeEntryResolver)’ [-fpermissive]
src/dart_sqlite.cc: In function ‘void PrepareStatement(Dart_NativeArguments)’:
src/dart_sqlite.cc:129:107: error: invalid conversion from ‘void (
)(Dart_Handle, void_) {aka void ()(Dart_Handle, void)}’ to ‘intptr_t {aka long int}’ [-fpermissive]
src/dart_sqlite.cc:129:107: error: too few arguments to function ‘Dart_WeakPersistentHandle Dart_NewWeakPersistentHandle(Dart_Handle, void*, intptr_t, Dart_WeakPersistentHandleFinalizer)’
In file included from src/dart_sqlite.cc:8:0:
src/dart_api.h:466:39: note: declared here

Linux 3.8.0-34-generic Ubuntu x86_64 x86_64 x86_64 GNU/Linux
Dart VM version: 1.3.0-dev.6.1 (Sat Mar 22 02:14:22 2014) on "linux_x64"

Library does not work when running inside docker container

Tried to run a script that imports package:sqlite/sqlite.dart inside google's latest docker dart image google/dart and it simply won't run with the following error:

libdart_sqlite.so: cannot open shared object file: No such file or directory

When doing the same steps outside of container on OS X, it all worked no problems.

Add a Makefile

This will be easier to use than the current sh script.

can I used in flutter ?

it show me:

root@well:/home/well/myflutter/customers# flutter run
Running 'flutter packages get' in customers... 12679ms
Error detected in application source code:
error: Unable to read Dart source 'package:sqlite/src/dart-ext:dart_sqlite'.

then ,i have no idea.

Error on noSuchMethod()

I have an error on noSuchMethod() :

"cannot override method noSuchMethod(InvocationMirror) from Object, wrong number of required parameters"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.