Skip to content

Commit

Permalink
fix(postgres): use DatabaseField<{type}> for type mapping if available
Browse files Browse the repository at this point in the history
  • Loading branch information
marcj committed Mar 19, 2024
1 parent 3f9da92 commit 107399a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/sql/src/platform/default-platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,11 @@ export abstract class DefaultPlatform {

protected getTypeMapping(type: Type): TypeMapping | undefined {
let mapping = undefined as TypeMapping | undefined;
const annotation = databaseAnnotation.getDatabase(type, this.annotationId);
if (annotation && annotation.type) {
return { sqlType: annotation.type };
}

for (const [checker, m] of this.typeMapping.entries()) {
if ('number' === typeof checker) {
if (checker === type.kind) mapping = m;
Expand Down

0 comments on commit 107399a

Please sign in to comment.