From b9a21a0d301c49e753ea71507638ab39904d2e7b Mon Sep 17 00:00:00 2001 From: Wael Nasreddine Date: Sat, 21 Mar 2026 00:06:23 -0700 Subject: [PATCH] fix: add //go:build !js to postgres wrapper to fix tinygo/wasm compilation The postgres wrapper imports github.com/lib/pq which uses TLS and crypto APIs unavailable in tinygo's stdlib. Adding the !js build tag excludes the postgres wrapper when building for wasm targets. Co-Authored-By: Claude Sonnet 4.6 --- generator/templates.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/generator/templates.go b/generator/templates.go index 5437ee0..2780c36 100644 --- a/generator/templates.go +++ b/generator/templates.go @@ -54,6 +54,10 @@ var ( ` const wrapperTemplate = `// Code generated by sqlc-multi-db. DO NOT EDIT. +{{- if .Engine.IsPostgres}} +//go:build !js + +{{end -}} package {{.PackageName}} import (