DBIx::C...:DBI::Pg(3)

Hiii bestie πŸ’– welcome to DBIx::C...:DBI::Pg(3), one of the User Contributed Perl Documentation pages β€” and yes, she’s here to make PostgreSQL primary keys behave.

🌸 NAME 🌸

DBIx::Class::Storage::DBI::Pg β€” automatic primary key class for PostgreSQL ✨

✨ SYNOPSIS ✨

         # In your result (table) classes
         use base 'DBIx::Class::Core';
         __PACKAGE__->set_primary_key('id');

πŸ¦‹ DESCRIPTION πŸ¦‹

This class implements autoincrements for PostgreSQL. That’s the whole vibe πŸ’…

πŸ’… POSTGRESQL SCHEMA SUPPORT πŸ’…

Okay so this driver supports multiple PostgreSQL schemas, with one caveat πŸ‘€ β€” for performance reasons, data about the search path, sequence names, and so forth is queried as needed and CACHED for subsequent uses.

Because of that, once your schema is instantiated, you should not change the PostgreSQL schema search path for that schema’s database connection. If you do…

Bad Things may happen. πŸ˜­πŸ’€

You should do any necessary manipulation of the search path BEFORE instantiating your schema object, or as part of the on_connect_do option to connect(), for example:

          my $schema = My::Schema->connect
                         ( $dsn,$user,$pass,
                           { on_connect_do =>
                               [ 'SET search_path TO myschema, foo, public' ],
                           },
                         );

πŸ‘‘ FURTHER QUESTIONS? πŸ‘‘

Check the list of additional DBIC resources. 🫢

This module is free software, copyright by the DBIx::Class (DBIC) authors. You can redistribute it and/or modify it under the same terms as the DBIx::Class library. 🌈


byeee bestie πŸ§šπŸ’œ β€” this page was served with perl v5.42.0 and dated 2025-01-22.

πŸ“¦ where this page comes from