From 6956eb2f7d2ee035e694fa97f726e533e79b9958 Mon Sep 17 00:00:00 2001 From: Dmitry Zakharov Date: Fri, 25 Oct 2024 16:58:00 +0400 Subject: [PATCH] Improve Batch Set error lil bit --- .../static/codegen/src/GqlDbCustomTypes.res | 12 +++++++----- .../static/codegen/src/db/DbFunctionsEntities.res | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/codegenerator/cli/templates/static/codegen/src/GqlDbCustomTypes.res b/codegenerator/cli/templates/static/codegen/src/GqlDbCustomTypes.res index ebacf5e9..f23f3602 100644 --- a/codegenerator/cli/templates/static/codegen/src/GqlDbCustomTypes.res +++ b/codegenerator/cli/templates/static/codegen/src/GqlDbCustomTypes.res @@ -26,9 +26,11 @@ module Int = { external fromStringUnsafe: string => int = "Number" - let schema = - S.union([ - S.int, - S.string->S.transform(_s => {parser: string => string->fromStringUnsafe}), - ])->S.setName("GqlDbCustomTypes.Int") + let schema = S.union([ + S.int, + S.string->S.transform(_s => { + parser: string => string->fromStringUnsafe, + serializer: Utils.magic, + }), + ])->S.setName("GqlDbCustomTypes.Int") } diff --git a/codegenerator/cli/templates/static/codegen/src/db/DbFunctionsEntities.res b/codegenerator/cli/templates/static/codegen/src/db/DbFunctionsEntities.res index f40e6b91..4f0cffcf 100644 --- a/codegenerator/cli/templates/static/codegen/src/db/DbFunctionsEntities.res +++ b/codegenerator/cli/templates/static/codegen/src/db/DbFunctionsEntities.res @@ -53,7 +53,7 @@ let makeBatchSet = (~table: Table.table, ~rowsSchema: S.schema | exception exn => exn->ErrorHandling.mkLogAndRaise( ~logger?, - ~msg=`Failed during batch read of entity ${table.tableName}`, + ~msg=`Failed during batch set of entity ${table.tableName}`, ) | res => res }