entc/gen: support backticks in snapshot (#3851)

This commit is contained in:
Jannik Clausen
2023-12-07 21:35:48 +01:00
committed by GitHub
parent f3fdbd6950
commit 5755614d3f
11 changed files with 33 additions and 11 deletions

View File

@@ -15,6 +15,7 @@ import (
"os"
"path/filepath"
"runtime/debug"
"strconv"
"strings"
"text/template/parse"
@@ -885,7 +886,7 @@ func (g *Graph) SchemaSnapshot() (string, error) {
if err != nil {
return "", err
}
return string(out), nil
return strconv.Quote(string(out)), nil
}
func (g *Graph) typ(name string) (*Type, bool) {