#4891 - Properly abstract ALTER queries

This is a spacer post for a website comment topic. The content this topic relates to: #4891 - Properly abstract ALTER queries
Some quick research tells me...

Only MySQL 8+ / MariaDB 10.5+ supports the "RENAME COLUMN" syntax. (which is better as the field type does not need respecifying)
Altering table column types also varies based on DB.
I think most DBs don't support altering column types and renaming at the same time like MySQL does - meaning we'll need to split the operations in our code.

I do not know what the ANSI standards are, if there are any for this kind of query.

Nice multi-DB overview:

https://www.techonthenet.com/sql/tables/alter_table.php
I did have a look at the ANSI standard. They do not seem to specify renaming columns, but do specify adding and dropping columns and changing types.
The ANSI standard is *horrible* to read, it's all defining a formal grammar and doesn't even show any examples of real SQL. Rant: What's the point of going to the extreme effort to define a standard in formal grammar (and failing to make a spec that is actually readable), when you can't even get any vendor to implement the standard well? (none do)
This was a lot of work. Done, with good automated testing.
0 guests and 0 members have recently viewed this.