Skip to main content
Tweeted twitter.com/StackDBAs/status/1019779708333056000
edited tags; edited title
Link
Evan Carroll
  • 64.7k
  • 49
  • 251
  • 496

Use cases for What are "Invisible Columns" and how are they used?

edited title
Link
Evan Carroll
  • 64.7k
  • 49
  • 251
  • 496

use Use cases for 'Invisible Columns' - CREATE TABLE t (x INT, y INT INVISIBLE, ...)"Invisible Columns"?

Source Link
Sybil
  • 2.6k
  • 6
  • 34
  • 61

use cases for 'Invisible Columns' - CREATE TABLE t (x INT, y INT INVISIBLE, ...)

I saw a new feature Invisible Columns in MariaDB 10.3.x. What are practical use cases for DBA and web developer? When to use this feature?

Columns can be given an INVISIBLE attribute in a CREATE TABLE or ALTER TABLE statement. These columns will then not be listed in the results of a SELECT * statement, nor do they need to be assigned a value in an INSERT statement, unless INSERT explicitly mentions them by name.

Since SELECT * does not return the invisible columns, new tables or views created in this manner will have no trace of the invisible columns. If specifically referenced in the SELECT statement, the columns will be brought into the view/new table, but the INVISIBLE attribute will not.

Invisible columns can be declared as NOT NULL, but then require a DEFAULT value