SLONIK_DEFINE(7)

πŸ“¦
version 2.2.11 Β· 4 versions
, in debian trixie, ubuntu questing

πŸ’– DEFINE πŸ’–

okay so bestie, we're reading slonik define(7) today β€” straight out of the Slony-I 2.2.11 documentation. it's a tiny page but it's lowkey iconic, so let's go πŸ¦‹


✨ NAME ✨

DEFINE β€” defining a named symbol. yes that's the whole name section. short king. πŸ’…


✨ SYNOPSIS ✨

define [ name ] [ value ]

✨ DESCRIPTION ✨

so this bad boy defines a named symbol. that's it, that's the job. 🌸

but there are rules, bestie, and you WILL respect them:

  • symbol names have to follow the slonik rules for constructing identifiers β€” so they start with a letter, and after that it's letters, numbers, and underscores. no starting with a number, no starting with a vibe. periodt. ✨
  • symbol values are way more chill β€” they may contain spaces, and they may recursively contain symbol references. yes, symbols inside symbols. it's giving inception, it's giving nesting dolls, it's giving main character energy. πŸŽ€

to actually reference a symbol, you use an @ followed by the symbol name. that's the whole handshake. 🀝

⚠️ but listen β€” symbol referencing is suppressed inside string literals. so if you put an @symbol inside quotes, it just... sits there. as text. do not expect the glow-up. πŸ’€

🌈 EXAMPLE 🌈

here's the whole flex, verbatim, because I would never edit a legend:

define    cluster movies;
define    sakai   1;
define    chen    2;
define    fqn     fully qualified name;

cluster name = @cluster;
node @sakai admin conninfo = 'service=sakai-replication';
node @chen  admin conninfo = 'service=chen-replication';
define setMovies    id = 1;
define sakaiMovies  @setMovies, origin = @sakai;

create set ( @sakaiMovies, comment = 'movies' );

set add table( set @sakaiMovies, id = 1, @fqn = 'public.customers',
               comment = 'sakai customers' );
set add table( set @sakaiMovies, id = 2, @fqn = 'public.tapes',
               comment = 'sakai tapes' );
echo 'But @sakaiMovies will display as a string, and is not expanded';

see that last echo line? yeah. that's the string literal thing I was yelling about. @sakaiMovies inside those quotes is NOT expanding, bestie, it's just vibing as plain text. 😭 go off I guess.


⭐ VERSION INFORMATION ⭐

this command was introduced in Slony-I 1.1. old money. πŸ‘‘


and that's the whole page!! 🫢 sourced from the Slony-I 2.2.11 Documentation, and dated 19 September 2024. love that for us. slay, stay defined, and don't forget the @. πŸ’–βœ¨πŸ§š

πŸ“¦ where this page comes from