DBIx-QuickORM

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

        orm myorm2 => sub {
            db 'mydb2';
            schema 'myschema2';
        };

        orm my_mix_a => sub {
            db 'mydb1';
            schema 'myschema2';
        };

        orm my_mix_b => sub {
            db 'mydb2';
            schema 'myschema1';
        };

    Used at the top level. Can contain `db`, `schema`, `handle_class`,
    `autofill`, plus `alt`, `plugin`, `plugins`, `meta`, and `build_class`.

- `alt $VARIANT => sub { ... }`

    Can be used to add variations to any builder:

        orm my_orm => sub {
            db mydb => sub {
                # ************************************
                alt mysql => sub {
                    dialect 'MySQL';
                };

                alt pgsql => sub {
                    dialect 'PostgreSQL';
                };
                # ************************************
            };

            schema my_schema => sub {
                table foo => sub {
                    column x => sub {
                        identity();

                        # ************************************
                        alt mysql => sub {
                            type \'BIGINT';
                        };

                        alt pgsql => sub {
                            type \'BIGSERIAL';
                        };
                        # ************************************
                    };
                }
            };
        };

    Variants can be fetched using the colon `:` in the name:

        my $pg_orm    = orm('my_orm:pgsql');
        my $mysql_orm = orm('my_orm:mysql');

    This works in `orm()`, `db()`, `schema()`, `table()`, and `row()` builders. It does
    cascade, so if you ask for the `mysql` variant of an ORM, it will also give you
    the `mysql` variants of the database, schema, tables and rows.

    Can be nested under any builder. Can contain whatever the builder it is nested
    under can contain.

- `db $NAME`
- `db $NAME => sub { ... }`
- `$db = db $NAME`
- `$db = db $NAME => sub { ... }`

    Used to define a database.

        db mydb => sub {
            dialect 'MySQL';
            host 'mysql.myapp.com';
            port 1234;
            user $MYSQL_USER;
            pass $MYSQL_PASS;
            db_name 'myapp_mysql';    # In mysql the db is named myapp_mysql
        };

    Can also be used to fetch a database by name:

        my $db = db('mydb');

    Can also be used to tell an ORM which database to use:

        orm myorm => sub {
            db 'mydb';
            ...
        };

    Used at the top level, or nested under `orm` or `server`. Can contain
    `driver`, `dialect`, `connect`, `attributes`, `creds`, `dsn`, `host`,
    `port`, `socket`, `user`, `pass`, and `db_name`.

- `dialect '+DBIx::QuickORM::Dialect::PostgreSQL'`
- `dialect 'PostgreSQL'`
- `dialect 'MySQL'`
- `dialect 'MySQL::MariaDB'`
- `dialect 'MySQL::Percona'`
- `dialect 'MySQL::Community'`
- `dialect 'SQLite'`

    Specify what dialect of SQL should be used. This is important for reading
    schema from an existing database, or writing new schema SQL.

    `DBIx::QuickORM::Dialect::` will be prefixed to the start of any string
    provided unless it starts with a plus `+`, in which case the plus is removed
    and the rest of the string is left unmodified.

    The following are all supported by DBIx::QuickORM by default

    - [PostgreSQL](https://metacpan.org/pod/DBIx%3A%3AQuickORM%3A%3ADialect%3A%3APostgreSQL)

        For interacting with PostgreSQL databases.

    - [MySQL](https://metacpan.org/pod/DBIx%3A%3AQuickORM%3A%3ADialect%3A%3AMySQL)

        For interacting with generic MySQL databases. Selecting this will auto-upgrade



( run in 1.355 second using v1.01-cache-2.11-cpan-0d23b851a93 )