Tangram::Remote(3pm)

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

πŸ’… Tangram::Remote β€” represent persistent objects in client space

okay bestie, gather round, because Tangram::Remote is literally the icon of this whole shindig πŸŽ€ (it's a page from the User Contributed Perl Documentation, and yes, we're about to make it make sense) ✨


🌸 SYNOPSIS 🌸

use Tangram;

$remote = $storage->remote( $class );
@remotes = $storage->remote( @classes );

... $remote->{$field} ...

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, and it's good tea β˜•

A Remote object is a client-side representation of an object that resides in a database. that's the whole vibe. it's not the object itself, it's the object's little stand-in that hangs out on the client side while the real one chills in the DB 🫢

It has the same fields as a normal object of the same class β€” exactly as declared in the Schema associated to the database the Remote was obtained from. no cap, whatever the Schema said, that's what you get πŸ’–

and here's the plot twist that makes it iconic: the values of those fields are not normal Perl values. nope. they're Tangram::Exprs, and they will be evaluated on the database server side πŸ”₯ so like, the work does not happen in your Perl process, it happens way over yonder, in the database. main character energy honestly πŸ‘‘

πŸ‘‘ lowkey the comparison to make: Remote objects are somewhat similar to SQL table aliases. iykyk πŸ’…

and now the disclaimer, because we keep it πŸ’― around here:

πŸ™ˆ not me telling you this β€” but there are literally no objects that are actually Tangram::Remote instances. the objects you'll be working with will be called Tangram::Expr::QueryObject et al. so don't come for Tangram::Remote looking for a blessed instance, because she does not exist, bestie 😭

πŸŽ€ a lil sign-off πŸŽ€

this page lives in perl v5.36.0, dated 2022-10-16 β€” and that is the moment, periodt πŸ’…βœ¨ go forth and remote responsibly πŸ¦‹πŸ’–πŸŒΈ

πŸ“¦ where this page comes from