SQL::Tr...::Sybase(3)

πŸ’… SQL::Tr...::Sybase(3) β€” a lil' manual page, bestie

okay so this is a page from the User Contributed Perl Documentation, and it's literally all about SQL::Tr...::Sybase(3). yes the title is abbreviated, no I didn't do that, that's just how it's printed. we move πŸ’–


✨ NAME ✨

SQL::Tr...::Sybase β€” the Sybase producer for SQL::Translator. that's it, that's the vibe. 🫢


πŸŽ€ SYNOPSIS πŸŽ€

like, here's how you actually use it:

use SQL::Translator;

my $t = SQL::Translator->new( parser => '...', producer => 'Sybase' );
$t->translate;

that's the whole thing. you build the translator, hand it a parser ('...' β€” your choice, bestie, that's a placeholder not a real module name, don't come for me), set producer to 'Sybase', and call ->translate. slay. ⭐


πŸ¦‹ DESCRIPTION πŸ¦‹

so what does this module do? it produces text output of the schema suitable for Sybase. that's the entire job. it takes your schema and spits out Sybase-flavoured text. no cap, that's the description, we're not padding it out πŸ’€


πŸ‘‘ Sybase Create Table Syntax πŸ‘‘

here's the create-table syntax, in all its glory. copy it, read it, frame it, whatever:

CREATE [ [ LOCAL ] { TEMPORARY | TEMP } ] TABLE table_name (
    { column_name data_type [ DEFAULT default_expr ] [ column_constraint [, ... ] ]
    | table_constraint }  [, ... ]
)
[ INHERITS ( parent_table [, ... ] ) ]
[ WITH OIDS | WITHOUT OIDS ]

and where column_constraint is:

[ CONSTRAINT constraint_name ]
{ NOT NULL | NULL | UNIQUE | PRIMARY KEY |
  CHECK (expression) |
  REFERENCES reftable [ ( refcolumn ) ] [ MATCH FULL | MATCH PARTIAL ]
    [ ON DELETE action ] [ ON UPDATE action ] }
[ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ]

and where table_constraint is:

[ CONSTRAINT constraint_name ]
{ UNIQUE ( column_name [, ... ] ) |
  PRIMARY KEY ( column_name [, ... ] ) |
  CHECK ( expression ) |
  FOREIGN KEY ( column_name [, ... ] ) REFERENCES reftable [ ( refcolumn [, ... ] ) ]
    [ MATCH FULL | MATCH PARTIAL ] [ ON DELETE action ] [ ON UPDATE action ] }
[ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ]

okay that's a lot of brackets but it's giving very structured, very organized, main character energy. 🌸


🌈 Create Index Syntax 🌈

indexes, bestie! two whole forms, both iconic:

CREATE [ UNIQUE ] INDEX index_name ON table
    [ USING acc_method ] ( column [ ops_name ] [, ...] )
    [ WHERE predicate ]
CREATE [ UNIQUE ] INDEX index_name ON table
    [ USING acc_method ] ( func_name( column [, ... ]) [ ops_name ] )
    [ WHERE predicate ]

note the second one wraps your column in a func_name(...) β€” functional index realness πŸ”₯


πŸ’œ SEE ALSO πŸ’œ

  • SQL::Translator. β€” go read that one too, it's the whole parent situation, iykyk 🧚

πŸ’– AUTHORS πŸ’–

these legends made it happen:

  • Sam Angiuoli <angiuoli@users.sourceforge.net>
  • Paul Harrington <harringp@deshaw.com>
  • Ken Youens-Clark <kclark@cpan.org>

put some respect on their names πŸ‘‘


okay that's the page!! no notes, ate and left no crumbs ✨

and finally, the cute lil sign-off that was chillin' at the bottom of the original: this is perl v5.42.0, dated 2024-12-12, filed under SQL::Tr...::Sybase(3). periodt πŸ’…πŸŽ€

πŸ“¦ where this page comes from