Tangra...ver::Pg(3pm)

πŸ“¦
version 2.12 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Tangram::Driver::Pg β€” Orthogonal Object Persistence in PostgreSQL databases 🐘✨

(yeah bestie, this is Tangra...ver::Pg(3pm) from the User Contributed Perl Documentation β€” the truncated lil name in the corner is just the system being quirky about column widths, the real one is right up there ⬆️)


πŸ¦‹ SYNOPSIS πŸ¦‹

use Tangram;
use Tangram::Driver::Pg;

$schema = Tangram::Driver::Pg->schema( $hashref );

Tangram::Driver::Pg->deploy($schema, $dbh);

$storage = Tangram::Driver::Pg->connect( $schema,
   $data_source, $username, $password );

$storage->disconnect();

Tangram::Driver::Pg->retreat($schema, $dbh);

🌸 DESCRIPTION 🌸

okay so. this is the entry point into the Pg-specific object-relational persistence backend. like, the front door. the main character of the PostgreSQL Tangram situation. πŸ‘‘

This module performs the following:

and then it just… doesn't say what follows. no list. no bullet points. nothing. the void. πŸ’€ bestie the docs really said "trust me" and moved on. anyway, moving on ourselves!

✨ METHODS ✨

ngl this backend is chill. it adds zero new methods. not one. it does not want the smoke, it does not want the spotlight, it just wants to persist your objects.

so if you need a rundown of the methods you actually get to call? go read Tangram::Relational. that's where the goods are. πŸ“š


🚨 ERRATA 🚨

okay this is the part where we sit down and have a little chat, because there are some gotchas here and you deserve to know. πŸ™ˆ

Tangram::Type::Dump::Storable objects get encoded with MIME::Base64 first. why? because Tangram doesn't currently have an easy mechanism for calling DBI->bind_param() at the appropriate time to flag the column as binary. so, base64 it is. that's the workaround, periodt.

Tangram::Type::Dump::Perl objects are stored as BYTEA columns β€” and as of DBD::Pg 1.31, those also don't get correctly escaped by the DBD driver. so that's bad. 😭

and it's not just that one! this also affects the (as-yet not fully functional) Tangram::Type::Dump::YAML back-end, which might put "\" characters into a YAML document. characters just wandering into your YAML uninvited. we love a chaotic cameo. ✨

πŸ’‘ for this reason, it is recommended to use the "storable" type with Tangram::Type::Dump::Any. do that. save yourself the heartbreak. 🫢

🌈 SEE ALSO… wait no 🌈

okay technically the only cross-reference the original gives us lives up in METHODS β€” Tangram::Relational, for all your method-description needs. consider yourself cross-referenced. πŸ’…


sign-off time πŸŽ€

this absolute gem is Tangra...ver::Pg(3pm) (yes, the name really does get chopped like that), sitting pretty at perl v5.36.0, dated 2022-10-16. take care of her, she's doing her best with those BYTEA columns. πŸ’–πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from