ID:1823616
 
Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.
It would be useful if you could get just the error number for mysql errors on connection and query objects.
Agreed. However the MySQL support doesn't lend itself to extensibility, so I don't have any current plans to expand it.
Yeah, we kind of just hacked it together back in the day and forgot about it.
One of the reasons I so much prefer the SQLite code is that it is extensible. The old DB stuff was multiple procs under the hood, but the new stuff is just one master proc that can be called with various arguments, making it trivial to expand.
The old DB stuff was Dan saying one day 'here's a list of procs I snuck into the language, enjoy', the library was the result of his initial stuff combined with what I did to make it more user-friendly. I always wanted to ditch the old MySQL stuff for a more general DBI implementation.

Dan initially planned to use a more generalized approach but it never got that far (the DBI: stuff in Dantom.DB was supposed to do more eventually).
That's why I've tended towards more generalized additions, especially in later stuff. Matrices for instance also are governed by a single proc under the hood.
Methinks a more general database handler system would be a good addition in the near future, it's a fairly important thing to have these days. The SQLite stuff already provides an insanely powerful local data storage system, expanding that to include things like MySQL would be pretty nice.

I've also hooked into a few of SQLite's text handling functions to speed up some stuff like replace(), but it's a bit clunky because I have to use dummy information and all sorts of mess. It works good but it's not good enough to justify the overhead it causes.
I imagine that adding ODBC support would solve all of these problems for power-users.
That's pretty much what I was thinking.
I'm just gonna note that this feature request is in part as a work around to the bug reported here: http://www.byond.com/forum/?post=1823614

"The mysql server has gone away" has a static error number that hasn't changed in decades, so being able to catch on it would be super helpful.

The other common one would be catching duplicate key errors for when you try to insert a row but the id/primary key already exists.