Bring Oracle to Dart


Allow server-side Dart access Oracle server.


import 'package:oracledart/oracledart.dart';

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

      (oracleConnection) {
        var resultset ="select job, avg(sal) from emp group by job");;
      onError: (error) {
        print("Failed to connect: $error");


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

To Use

  1. This extension is built with bleeding_edge of Dart. Since Dart native extensions use C++ dart_api interface to integrate into Dart, they won't be necessarily compatible with older version of Dart.

  2. This extension requires Oracle Instant Client being present on the machine. It is being tested with version instantclient-basic-nt- on Windows, instantclient_11_2 on Linux and Mac.

You need to have OCCI binaries in the path for extension to work.

Here is how sample path setting might look like on Windows:

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

on Linux

export LD_LIBRARY_PATH=~/Downloads/instantclient_11_2

or on Mac

export DYLD_LIBRARY_PATH=~/Downloads/instantclient_11_2-2

Source code

Complete source code including C++ modules is at

Automated testing

Automated test is running at

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.