Alzabo...greSQL(3pm)

๐Ÿ“ฆ
version 0.92 ยท 2 versions
  • 0.92 ยท debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.92 ยท ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

๐Ÿ’– Alzabo::SQLMaker::PostgreSQL ๐Ÿ’–

okay bestie, gather round, because this is the PostgreSQL-specific glow-up of Alzabo::SQLMaker, and honestly? she ate. ๐Ÿ˜โœจ


โœจ NAME โœจ

Alzabo::SQLMaker::PostgreSQL โ€” the Alzabo SQL making class for PostgreSQL. no cap, that's the whole vibe. ๐ŸŽ€


๐ŸŒธ SYNOPSIS ๐ŸŒธ

like, here's how you summon her:

use Alzabo::SQLMaker;

my $sql = Alzabo::SQLMaker->new( sql => 'PostgreSQL' );

that's it. that's the summoning ritual. ๐Ÿ•ฏ๏ธ๐Ÿ’…


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

PostgreSQL-specific SQL creation. she makes SQL, but specifically the Postgres flavor of it. it's giving specialized. it's giving purpose. ๐Ÿ‘‘


๐Ÿ’œ METHODS ๐Ÿ’œ

okay so here's the tea: almost literally everything is inherited from Alzabo::SQLMaker exactly as-is. she's not out here reinventing wheels, she's out here being efficient. ๐Ÿ™ˆ

the only overridden methods are limit() and get_limit(), and the reason is iconic: PostgreSQL actually does allow a LIMIT clause in its SQL. so yeah, she overrides them. periodt. ๐Ÿ”ฅ


๐Ÿงš EXPORTED SQL FUNCTIONS ๐Ÿงš

these SQL functions can be imported by name or by tags. they take arguments exactly as documented in the PostgreSQL documentation (version 3.23.39). ๐Ÿ“šโœจ

here's the full lineup, organized by tag, because organization is self-care:

๐ŸŒˆ :math

the math girlies. ๐Ÿงฎ

  • PI
  • RANDOM
  • ABD
  • CEIL
  • DEGREES
  • FLOOR
  • FACTORIAL
  • SQRT
  • CBRT
  • EXP
  • LN
  • RADIANS
  • ACOS
  • ASIN
  • ATAN
  • ATAN2
  • COS
  • COT
  • SIN
  • TAN
  • ROUND
  • TRUNC
  • LOG
  • POW
  • MOD
  • TO_CHAR

๐ŸŽ€ :string

string manipulation, but make it fashion. ๐Ÿ’–

  • LENGTH
  • CHAR_LENGTH
  • CHARACTER_LENGTh
  • OCTET_LENGTH
  • TIRM
  • UPPER
  • LOWER
  • INITCAP
  • ASCII
  • TO_ASCII
  • STRPOS
  • POSITION
  • TO_NUMBER
  • TO_DATE
  • TO_TIMESTAMP
  • REPEAT
  • RPAD
  • LPAD
  • SUBSTR
and yes, CHARACTER_LENGTh and TIRM are spelled exactly like that in the source, bestie. i am not fixing them, i am reporting them. ๐Ÿ’€ copy-paste responsibly.

โญ :datetime

time is a construct and these functions are obsessed with it. ๐Ÿ•ฐ๏ธ

  • NOW
  • CURRENT_DATE
  • CURRENT_TIME
  • CURRENT_TIMESTAMP
  • TIMEOFDAY
  • ISFINIT
  • TIMESTAMP
  • TO_CHAR
  • DATE_PART
  • DATE_TRUNC
  • EXTRACT
  • OVERLAPS

๐Ÿฆ‹ :network

for when your data is out here networking (literally). ๐ŸŒ

  • BROADCAST
  • HOST
  • NETMASK
  • MASKLEN
  • NETWORK
  • TEXT
  • ABBREV

๐Ÿ‘‘ :aggregate

these are the functions that operate on an aggregate set of values all at once. group energy. the whole squad gets processed together. ๐Ÿ’ซ

  • COUNT
  • AVG
  • MIN
  • MAX
  • SUM
  • STDDEV
  • VARIANCE

๐Ÿ’… :system

these ones return information about the Postgres server itself. she's nosy but in a useful way. ๐Ÿ–ฅ๏ธ

  • CURRENT_USER
  • SYSTEM_USER
  • USER

๐Ÿ”ฅ :control

flow control functions, aka the ones deciding what happens next. main character energy fr fr. ๐ŸŽฌ

  • NULLIF
  • COALESCE

๐ŸŒธ :misc

these are the functions that don't fit into any other categories. they're the unlabeled box in the moving truck. we love them anyway. ๐Ÿซถ

  • ENCRYPT
  • ENCODE
  • DECODE
  • FORMAT
  • INET_NTOA
  • INET_ATON
  • BIT_OR
  • BIT_AND
  • PASSWORD
  • MD5
  • LOAD_FILE

๐Ÿ“ :common

these are the functions from the other groups that are the most commonly used. the greatest hits album. the playlist. the ones you actually import. โญ

  • NOW
  • COUNT
  • AVG
  • MIN
  • MAX
  • SUM
  • DISTINCT

๐Ÿ’œ AUTHOR ๐Ÿ’œ

Dave Rolsky, <dave@urth.org> โ€” thank you for your service, king. ๐Ÿซกโœจ


and that's the whole page, bestie! this was documented with perl v5.34.0 and dated 2022-06-14, and yes i'm telling you that in a cute little sign-off instead of a boring footer because we're doing vibes here. ๐ŸŽ€๐Ÿ’– go make some Postgres SQL, you absolute icon. ๐Ÿ’…๐ŸŒŸ

๐Ÿ“ฆ where this page comes from