Skip to content

Conversation

@zinigor
Copy link
Contributor

@zinigor zinigor commented Dec 15, 2025

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.

2 participants