Giter Site home page Giter Site logo

doctrine-dbal-ibmi's Introduction

doctrine-dbal-ibmi

Build Status

Doctrine DBAL module for DB2 on the IBM i platform.

Based on the original work by @cassvail in doctrine/dbal#910.

Usage

First, install with Composer:

$ composer require alanseiden/doctrine-dbal-ibmi

Configuration

In your connection configuration, use this specific DB2Driver class, for example, when configuring for a Zend Expressive application:

<?php

return [
    'doctrine' => [
        'connection' => [
            'orm_default' => [
                'driverClass' => \DoctrineDbalIbmi\Driver\DB2Driver::class,
                'params' => [
                    'host'     => '...',
                    'user'     => '...',
                    'password' => '...',
                    'dbname'   => '...',
                    'persistent' => true,
                    'driverOptions' => [
                        'i5_naming' => DB2_I5_NAMING_OFF,
                        'i5_commit' => DB2_I5_TXN_NO_COMMIT,
                        'i5_lib' => '...',
                    ],
                ],
            ],
        ],
    ],
];

Manual Configuration

You can manually configure an EntityManager like so:

<?php

$configuration = \Doctrine\ORM\Tools\Setup::createAnnotationMetadataConfiguration([
    __DIR__ . '/../path/to/your/entities/',
], true);

$connection = [
    'driverClass' => \DoctrineDbalIbmi\Driver\DB2Driver::class,
    'host' => '...', // Replace this
    'user' => '...', // Replace this
    'password' => '...', // Replace this
    'dbname' => '...', // Look up value with WRKRDBDIRE
    'persistent' => true,
    'driverOptions' => [
        'i5_lib' => '...', // Replace this
        'i5_naming' => DB2_I5_NAMING_OFF,
        'i5_commit' => DB2_I5_TXN_NO_COMMIT,
    ],
];

$entityManager = \Doctrine\ORM\EntityManager::create($connection, $configuration);

You can then use this instance of $entityManager.

doctrine-dbal-ibmi's People

Contributors

alanseiden avatar asgrim avatar

Watchers

 avatar  avatar  avatar

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.