Bring Oracle to Dart

Goal

Allows server-side Dart access Oracle server.

Sample

import 'package:oracledart/oracledart.dart';

void main() {
  print("Hello, World!");

  connect(
    "scott",
    "tiger",
    "(DESCRIPTION="
      "(ADDRESS=(PROTOCOL=TCP)(HOST=oracledb)(PORT=1521))"
      "(CONNECT_DATA=(SERVICE_NAME=XE)(SERVER=DEDICATED)))")
    .then(
      (oracleConnection) {
        var resultset = oracleConnection.select("select job, avg(sal) from emp group by job");
        resultset.next();
        print(resultset.getString(1));
      },
      onError: (error) {
        print("Failed to connect: $error");
      });
}

produces

F:\dart-sdk\bin\dart.exe --enable-checked-mode --debug:53673 otest.dart
Hello, World!
CLERK

To Use

This extension requires Oracle Instant Client being present on the machine. It is being tested with version instantclient-basic-nt-12.1.0.1.0.

You need to have OCCI binaries in the path for extension to work. Here is how sample path setting might look like:

set path=%userprofile%\downloads\instantclient-basic-nt-12.1.0.1.0\instantclient_12_1\vc11;%userprofile%\downloads\instantclient-basic-nt-12.1.0.1.0\instantclient_12_1;%path%

Source code

Complete source code including C++ modules is at https://github.com/aam/oracledart

Automated testing

Automated test is running at http://buildbot.aprelev.com:8009/waterfall.

Tests are automatically executed on three platforms: Windows, Ubuntu and Mac on every commit into dart bleeding_edge branch and every commit into OracleDart git repository.

Libraries

oracledart