Skip to content

Added the database module storage adapter. - #9

Merged
zinigor merged 2 commits into
mainfrom
add/database-module-adapter
Dec 15, 2025
Merged

Added the database module storage adapter.#9
zinigor merged 2 commits into
mainfrom
add/database-module-adapter

Conversation

@zinigor

@zinigor zinigor commented Dec 15, 2025

Copy link
Copy Markdown
Contributor

This is an adapter that allows the database-module to be used as the PluralObject storage option:

        $storage = new DatabaseModuleStorage( 'tdb_table_name' );

        $storage->register( 'tdb_table_name', [
            'schema' => [
                'id' => [
                    'type'           => 'bigint',
                    'length'         => '20',
                    'auto_increment' => true,
                    'primary_key'    => true,
                ],
                'title' => [
                    'type'   => 'varchar',
                    'length' => '255',
                ],
            ],
        ] );

        $dataset = new DataSet();
        $dataset->add_string( 'title' );

        $object = new PluralObject( 'tdb_plural_list', $storage );
        $object->set_dataset( $dataset );

@zinigor zinigor self-assigned this Dec 15, 2025
@zinigor
zinigor merged commit 8c4b696 into main Dec 15, 2025
3 checks passed
@zinigor
zinigor deleted the add/database-module-adapter branch December 15, 2025 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant