1

Has anybody managed to make use of the odbc library on linux / ubuntu 14.04 with the odbc driver for mariadb 10.1? After install from pub and running a test case, I get the error

Cannot find extension library'package:odbc/odbc.dart': error: line 25 pos 1: library handler failed
import "dart-ext:odbc_ext";
^

And if I want to compile the extension I get a peculiar error:

odbc_ext_sql.cc:148:64: error: ‘SQLCancelHandle’ was not declared in this scope
                                         unboxSqlHandle(ARGS(1)));
                                                                ^
odbc_ext_sql.cc: In function ‘void sqlSetParam(Dart_NativeArguments)’:
odbc_ext_sql.cc:904:64: error: cannot convert ‘SQLINTEGER* {aka int*}’ to ‘SQLLEN* {aka long int*}’ for argument ‘8’ to ‘SQLRETURN SQLSetParam(SQLHSTMT, SQLUSMALLINT, SQLSMALLINT, SQLSMALLINT, SQLULEN, SQLSMALLINT, SQLPOINTER, SQLLEN*)’
                                     unboxSqlIntegerPtr(ARGS(7)));
                                                                ^

I would prefer this way over mysql/sqljocky and need to evaluate if its a good fit for production.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
Dr. Dama
  • 167
  • 2
  • 5
  • Where have you stored the Dart script file that imports `'package:odbc/odbc.dart'` `your_package/bin` or in a subdirectory of bin or another directory?. Maybe you are missing a symlink to `packages` or you package cache is corrupted (try `pub cache repair` on the command line). – Günter Zöchbauer Oct 21 '14 at 04:03
  • Have you tried the https://pub.dartlang.org/packages/sqljocky package? – Günter Zöchbauer Oct 21 '14 at 04:06
  • I used sqljocky already with mysql. I wanted to do a performance comparison with odbc drivers, because the connection will be persistent anyway and I expected serious gains from the low level implementation. – Dr. Dama Oct 21 '14 at 09:44
  • I tried "pub cache repair", didn't help and I have the scripts in the bin folder. I thought the trouble would come from the missing .so library, so I tried to compile the source. Regarding that I am not sure how much sense it makes since there is no odbc sdk for mariadb and I am not sure if it is mandatory. – Dr. Dama Oct 21 '14 at 09:47
  • I wouldn't expect better performance by using ODBC. SqlJocky is just a wrapper for the native MySql client and ODBC is usually notable slower than database specific clients. – Günter Zöchbauer Oct 21 '14 at 09:48
  • import "dart-ext:odbc_ext";` is referencing the library within the package. Its a compiled dynamic loadable library. I agree odbc not being superior in general. Depends on the native language implementation. I haven't inspected sqljocky entirely so I can't tell if time complexity of the interpreter is O(n) or O(2n) or O(n+5) which usually is negligible, especially through msyql cache, but matters if you are having thousands of tiny requests. ODBC could be superior regarding networking, but in depth I am not aware. – Dr. Dama Oct 21 '14 at 10:17
  • I haven't done anything with native extensions yet. I found a similar question but related to Windows and I guess there are notable differences between Windows and Linux native libs. – Günter Zöchbauer Oct 21 '14 at 10:24
  • 1
    Definitely! Especially the reason why anybody would voluntarily choose a MS development environment :) – Dr. Dama Oct 21 '14 at 10:51

0 Answers0