ClaireNeveu / sij

Deep embeddding of standard SQL into javascript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Schema support.

ClaireNeveu opened this issue · comments

Most capital "s" Schema constructs in SQL can be scoped by schema. This is going to require restructuring of references to these types (maybe). Obvious solution here is to nest tables under schemae in the Schema type. But I think using dot-separated names might actually simplify things a lot and maybe I won't have to adjust Query code at all at the type level (will still need to split the passed string into a qualified Ident).

Downsides of the "foo.bar" approach is that in schema construction I won't be able to guarantee that a schema exists when you reference it. If I went the nested approach though I'd want to provide a shortcut syntax for people who don't use schemas. That might require a lot of ugly branching in the code.

I kind of think it's not worth it since the schema definition doesn't gain as much value from strong typing. On the other hand I do need to carry some kind of type information for domains anyway, but those also aren't referenced in the query language (unless you can cast to a domain?).