dbml icon indicating copy to clipboard operation
dbml copied to clipboard

Spec: add 'Struct' definition

Open quenbyako opened this issue 5 years ago • 8 comments

Worth to add structs with some simple syntax like this:

Struct some_struct {
  field_a integer
  field_b text
}

Reason is PostgreSQL, Oracle DB, IBM DataStage, Ms SQL Server etc sql databases has custom struct type.

I think, that dbml was made not only for sqlite :smile:

// P.S. i'll try to add more info bit later

quenbyako avatar Oct 27 '20 13:10 quenbyako

Thanks @ololosha228. This is a valid request and something we're keen to add. Will definitely look into this.

nvquanghuy avatar Dec 04 '20 15:12 nvquanghuy

@nvquanghuy any status?

or @phuongduyphan, i don't know who is main maintainer)))

quenbyako avatar Jan 12 '21 13:01 quenbyako

@phuongduyphan @nvquanghuy is this proposall accepted, rejected, pending, or what? Am i need to fork this spec and all plugins or what?

Does DBML specification has any committee to discuss and make decisions on proposals? Or i just write these questions into the void and one of cool projects is dead again?

quenbyako avatar Feb 12 '21 16:02 quenbyako

Hi @quenbyako, apologize for the late response. We've been having a bit of a manpower issue internally and I'm trying to sort this out, that's why this has been put on hold. Once we sort that out we'll be resuming to look into this. I understand Struct is super common, so I'm keen to get this implemented asap.

nvquanghuy avatar Feb 24 '21 11:02 nvquanghuy

@nvquanghuy thanks for answer!

I'll try to provide more info about struct types in different databases (like add here more info about how to manage types in mysql, postgres, etc)

Glad to hear that proposal is accepted!

quenbyako avatar Feb 24 '21 14:02 quenbyako

@nvquanghuy came back after researching:

sql db name how to create custom type
mysql native types not supported (you need to create a separate table with a structure and link it with the desired table)
postgres super simple
mariadb same as mysql (but they have proposal at least)
sqlite same as mysql
mssql has CREATE TYPE statement
oracle db also has custom types (see "Purchase Order Example" in "User-Defined Datatype Categories")

quenbyako avatar Mar 08 '21 15:03 quenbyako

I would be interested about any updates on this feature request, would be extremely useful to document properly custom types.

giacomomiolo avatar Sep 15 '21 10:09 giacomomiolo