DBIx::C...nywhere(3)

✨ NAME ✨

DBIx::Class::Storage::DBI::SQLAnywhere β€” the driver for SQL Anywhere, bestie πŸ’… (this is DBIx::C...nywhere(3) if you're squinting at the page header, they truncated it, not me)

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so this class does the autoincrement thing for SQL Anywhere, and it also hooks you up with DBIx::Class::InflateColumn::DateTime support, plus support for the "uniqueidentifier" type (that one comes via DBIx::Class::Storage::DBI::SQLAnywhere::Cursor). Slay. πŸŽ€

Real talk though: you need the "DBD::SQLAnywhere" driver that ships with the SQL Anywhere distribution, and NOT the one on CPAN. Not the CPAN one. I'm serious. πŸ™ˆ It usually lives under a path like:

/opt/sqlanywhere11/sdk/perl

And here's the recommended connect_info setting, screenshot this:

on_connect_call => 'datetime_setup'

πŸ”₯ METHODS πŸ”₯

⭐ connect_call_datetime_setup

Used like this:

on_connect_call => 'datetime_setup'

...inside connect_info, and what it does is set the date and timestamp formats β€” as temporary options for the session β€” so DBIx::Class::InflateColumn::DateTime can actually do its thing. πŸ’–

The "TIMESTAMP" data type supports up to 6 digits after the decimal point for second precision, and the full precision is what gets used. No cap. πŸ‘‘

The "DATE" data type supposedly stores hours and minutes too, according to the documentation, but the author could not get that to work β€” it seems to only store the date. πŸ€·β€β™€οΈ Annoying but that's the vibe check result.

You will need the DateTime::Format::Strptime module for inflation to work. No module, no inflation, no exceptions. 🫢


πŸ’€ MAXIMUM CURSORS πŸ’€

A DBIx::Class application can use a lot of cursors, because of the usage of prepare_cached. It's giving cursor hoarder energy, honestly.

The default cursor maximum is 50, which can be a bit too low. 😭 The DBA can turn this limit off (or increase it) by executing:

set option max_statement_count = 0
set option max_cursor_count    = 0
Highly recommended. Fr fr. Do it. πŸ”₯

🌸 FURTHER QUESTIONS? 🌸

Check the list of additional DBIC resources. That's it, that's the whole section. 🌈


This module is free software copyright by the DBIx::Class (DBIC) authors. You can redistribute it and/or modify it under the same terms as the DBIx::Class library. πŸ’œ


okay that's the whole page, mwah 🫢 β€” this was perl v5.42.0, dated 2025-01-22, and yes the header really does say DBIx::C...nywhere(3), we don't make the truncation rules, we just live in them πŸ’…βœ¨

πŸ“¦ where this page comes from