Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #49
StructureMap
using module augmentation instead of usingzapatos/schema
. This approach is more modular, allows an arbitrary number of modules making extensions to Zapatos (as long as there are no name collisions). This is similar to howHTMLElementTagNameMap
works. If there are name collisions across modules (e.g. multiple databases), the optionglobalStructureName
can be used to solve the conflict or to disable augmentation ofStructureMap
.By default,
sql
and shortcuts useSQL
andSQLStructure
for inference which derive all of their information fromStructureMap
.Adds support for inferring the schema name of the table from the database.
SQLStructure
to use in a shortcut and also maintain type inference in the rest of type arguments. It's necessary to workaround microsoft/TypeScript#26242, so I created 2 shortcuts to make it possbile:table
andtables
.In order to make zapatos compatible with multiple databases, I had to use a modular architecture to avoid conflicts. Now zapatos doesn't require centralized ambient modules or namespaces, it can work only by passing type arguments to functions. Optionally,
StructureMap
can be augmented to provide centralized typings, but the user can choose to disable it or can configure how to resolve name conflicts.There are a few tasks left, like changing howschema/custom
works to be more modular. I don't know much about how those custom types are used and, if some maintainer can help me, I'm going to need some help withschema/custom
and polishing this PR.EDIT: Change
schema/custom
to modules