diff --git a/entc/gen/template/base.tmpl b/entc/gen/template/base.tmpl index 8e7ffbfe1..4f0592c58 100644 --- a/entc/gen/template/base.tmpl +++ b/entc/gen/template/base.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "base" }} {{ $pkg := base $.Config.Package }} diff --git a/entc/gen/template/builder/create.tmpl b/entc/gen/template/builder/create.tmpl index c144921fc..f41eacbf3 100644 --- a/entc/gen/template/builder/create.tmpl +++ b/entc/gen/template/builder/create.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "create" }} {{ $pkg := base $.Config.Package }} diff --git a/entc/gen/template/builder/delete.tmpl b/entc/gen/template/builder/delete.tmpl index cc1bea32f..18c1031d0 100644 --- a/entc/gen/template/builder/delete.tmpl +++ b/entc/gen/template/builder/delete.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "delete" }} {{ $pkg := base $.Config.Package }} diff --git a/entc/gen/template/builder/query.tmpl b/entc/gen/template/builder/query.tmpl index df8386cc2..6811902c9 100644 --- a/entc/gen/template/builder/query.tmpl +++ b/entc/gen/template/builder/query.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "query" }} {{ $pkg := base $.Config.Package }} diff --git a/entc/gen/template/builder/setter.tmpl b/entc/gen/template/builder/setter.tmpl index 2bdb71d7d..17d2a48b2 100644 --- a/entc/gen/template/builder/setter.tmpl +++ b/entc/gen/template/builder/setter.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "setter" }} {{ $builder := pascal $.Scope.Builder }} {{ $receiver := receiver $builder }} diff --git a/entc/gen/template/builder/update.tmpl b/entc/gen/template/builder/update.tmpl index 7fe3a31dc..df933fda3 100644 --- a/entc/gen/template/builder/update.tmpl +++ b/entc/gen/template/builder/update.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "update" }} {{ $pkg := base $.Config.Package }} diff --git a/entc/gen/template/client.tmpl b/entc/gen/template/client.tmpl index 812386923..e493f2cd4 100644 --- a/entc/gen/template/client.tmpl +++ b/entc/gen/template/client.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "client" }} {{ $pkg := base $.Config.Package }} diff --git a/entc/gen/template/config.tmpl b/entc/gen/template/config.tmpl index c2613731c..486a88eab 100644 --- a/entc/gen/template/config.tmpl +++ b/entc/gen/template/config.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "config" }} {{ $pkg := base $.Config.Package }} diff --git a/entc/gen/template/context.tmpl b/entc/gen/template/context.tmpl index 8a908e470..79255ec4e 100644 --- a/entc/gen/template/context.tmpl +++ b/entc/gen/template/context.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "context" }} {{ $pkg := base $.Config.Package }} diff --git a/entc/gen/template/dialect/gremlin/by.tmpl b/entc/gen/template/dialect/gremlin/by.tmpl index 8a79fc88f..02f37e0a2 100644 --- a/entc/gen/template/dialect/gremlin/by.tmpl +++ b/entc/gen/template/dialect/gremlin/by.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "dialect/gremlin/order" -}} {{- $order := $.Scope.Order -}} func(tr *dsl.Traversal) { diff --git a/entc/gen/template/dialect/gremlin/create.tmpl b/entc/gen/template/dialect/gremlin/create.tmpl index f45bf086d..b9413c00e 100644 --- a/entc/gen/template/dialect/gremlin/create.tmpl +++ b/entc/gen/template/dialect/gremlin/create.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "dialect/gremlin/create" }} {{ $builder := pascal $.Scope.Builder }} {{ $receiver := receiver $builder }} diff --git a/entc/gen/template/dialect/gremlin/decode.tmpl b/entc/gen/template/dialect/gremlin/decode.tmpl index 4d9edcfab..8ffa1e23e 100644 --- a/entc/gen/template/dialect/gremlin/decode.tmpl +++ b/entc/gen/template/dialect/gremlin/decode.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "dialect/gremlin/decode/one" }} {{ $receiver := $.Receiver }} diff --git a/entc/gen/template/dialect/gremlin/delete.tmpl b/entc/gen/template/dialect/gremlin/delete.tmpl index 47e18f42c..bf1a64c93 100644 --- a/entc/gen/template/dialect/gremlin/delete.tmpl +++ b/entc/gen/template/dialect/gremlin/delete.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "dialect/gremlin/delete" }} {{ $builder := pascal $.Scope.Builder }} {{ $receiver := receiver $builder }} diff --git a/entc/gen/template/dialect/gremlin/errors.tmpl b/entc/gen/template/dialect/gremlin/errors.tmpl index d42dfb3a8..1b3909454 100644 --- a/entc/gen/template/dialect/gremlin/errors.tmpl +++ b/entc/gen/template/dialect/gremlin/errors.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{/* custom errors and errors handlers from sql dialects */}} {{ define "dialect/gremlin/errors" }} {{ $pkg := base $.Config.Package }} diff --git a/entc/gen/template/dialect/gremlin/group.tmpl b/entc/gen/template/dialect/gremlin/group.tmpl index f292b558a..542fb6c1e 100644 --- a/entc/gen/template/dialect/gremlin/group.tmpl +++ b/entc/gen/template/dialect/gremlin/group.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "dialect/gremlin/group" }} {{ $builder := pascal $.Scope.Builder }} {{ $receiver := receiver $builder }} diff --git a/entc/gen/template/dialect/gremlin/meta.tmpl b/entc/gen/template/dialect/gremlin/meta.tmpl index d3d920f3a..5ae658022 100644 --- a/entc/gen/template/dialect/gremlin/meta.tmpl +++ b/entc/gen/template/dialect/gremlin/meta.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{/* constants needed for gremlin dialects. */}} {{ define "dialect/gremlin/meta/constants" }} {{ range $_, $e := $.Edges }}{{ $label := $e.Constant -}} diff --git a/entc/gen/template/dialect/gremlin/predicate.tmpl b/entc/gen/template/dialect/gremlin/predicate.tmpl index 731851c2b..13d8e6bbc 100644 --- a/entc/gen/template/dialect/gremlin/predicate.tmpl +++ b/entc/gen/template/dialect/gremlin/predicate.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "dialect/gremlin/predicate/id" -}} func(t *dsl.Traversal) { t.HasID(id) diff --git a/entc/gen/template/dialect/gremlin/query.tmpl b/entc/gen/template/dialect/gremlin/query.tmpl index 4922f6f34..c7c78ad3c 100644 --- a/entc/gen/template/dialect/gremlin/query.tmpl +++ b/entc/gen/template/dialect/gremlin/query.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "dialect/gremlin/query" }} {{ $builder := pascal $.Scope.Builder }} {{ $receiver := receiver $builder }} diff --git a/entc/gen/template/dialect/gremlin/update.tmpl b/entc/gen/template/dialect/gremlin/update.tmpl index 3d61e578a..b979b3382 100644 --- a/entc/gen/template/dialect/gremlin/update.tmpl +++ b/entc/gen/template/dialect/gremlin/update.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "dialect/gremlin/update" }} {{ $builder := pascal $.Scope.Builder }} {{ $receiver := receiver $builder }} diff --git a/entc/gen/template/dialect/sql/by.tmpl b/entc/gen/template/dialect/sql/by.tmpl index a4b6c5a51..2988a5c4f 100644 --- a/entc/gen/template/dialect/sql/by.tmpl +++ b/entc/gen/template/dialect/sql/by.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "dialect/sql/order" -}} {{- $f := $.Scope.Func -}} func(s *sql.Selector) { diff --git a/entc/gen/template/dialect/sql/create.tmpl b/entc/gen/template/dialect/sql/create.tmpl index 41e3cf4fc..d8b39c358 100644 --- a/entc/gen/template/dialect/sql/create.tmpl +++ b/entc/gen/template/dialect/sql/create.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "dialect/sql/create" }} {{ $builder := pascal $.Scope.Builder }} {{ $receiver := receiver $builder }} diff --git a/entc/gen/template/dialect/sql/decode.tmpl b/entc/gen/template/dialect/sql/decode.tmpl index f5944e222..ed1adaad8 100644 --- a/entc/gen/template/dialect/sql/decode.tmpl +++ b/entc/gen/template/dialect/sql/decode.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "dialect/sql/decode/one" }} {{ $receiver := $.Receiver }} diff --git a/entc/gen/template/dialect/sql/delete.tmpl b/entc/gen/template/dialect/sql/delete.tmpl index 728522bf1..89663fc4e 100644 --- a/entc/gen/template/dialect/sql/delete.tmpl +++ b/entc/gen/template/dialect/sql/delete.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "dialect/sql/delete" }} {{ $builder := pascal $.Scope.Builder }} {{ $receiver := receiver $builder }} diff --git a/entc/gen/template/dialect/sql/errors.tmpl b/entc/gen/template/dialect/sql/errors.tmpl index 9805b5045..fb10acd91 100644 --- a/entc/gen/template/dialect/sql/errors.tmpl +++ b/entc/gen/template/dialect/sql/errors.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{/* custom errors and errors handlers from sql dialects */}} {{ define "dialect/sql/errors" }} func isSQLConstraintError(err error) (*ErrConstraintFailed, bool) { diff --git a/entc/gen/template/dialect/sql/group.tmpl b/entc/gen/template/dialect/sql/group.tmpl index 3372acab0..f9da4357a 100644 --- a/entc/gen/template/dialect/sql/group.tmpl +++ b/entc/gen/template/dialect/sql/group.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "dialect/sql/group" }} {{ $builder := pascal $.Scope.Builder }} {{ $receiver := receiver $builder }} diff --git a/entc/gen/template/dialect/sql/meta.tmpl b/entc/gen/template/dialect/sql/meta.tmpl index ec5d533f3..9966c45dd 100644 --- a/entc/gen/template/dialect/sql/meta.tmpl +++ b/entc/gen/template/dialect/sql/meta.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{/* constants needed for sql dialects. */}} {{ define "dialect/sql/meta/constants" }} // Table holds the table name of the {{ lower $.Name }} in the database. diff --git a/entc/gen/template/dialect/sql/predicate.tmpl b/entc/gen/template/dialect/sql/predicate.tmpl index 06105abcc..cc3a70c5b 100644 --- a/entc/gen/template/dialect/sql/predicate.tmpl +++ b/entc/gen/template/dialect/sql/predicate.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "dialect/sql/predicate/id" -}} func(s *sql.Selector) { {{- if $.ID.IsString }}id, _ := strconv.Atoi(id){{- end }} diff --git a/entc/gen/template/dialect/sql/query.tmpl b/entc/gen/template/dialect/sql/query.tmpl index cc8bea6f3..4c76cf339 100644 --- a/entc/gen/template/dialect/sql/query.tmpl +++ b/entc/gen/template/dialect/sql/query.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "dialect/sql/query" }} {{ $pkg := $.Scope.Package }} {{ $builder := pascal $.Scope.Builder }} diff --git a/entc/gen/template/dialect/sql/update.tmpl b/entc/gen/template/dialect/sql/update.tmpl index f83451a0f..4533fb0c1 100644 --- a/entc/gen/template/dialect/sql/update.tmpl +++ b/entc/gen/template/dialect/sql/update.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "dialect/sql/update" }} {{ $pkg := $.Scope.Package }} {{ $builder := pascal $.Scope.Builder }} diff --git a/entc/gen/template/ent.tmpl b/entc/gen/template/ent.tmpl index 8fd960cb1..4e5ba53ed 100644 --- a/entc/gen/template/ent.tmpl +++ b/entc/gen/template/ent.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "model" }} {{ $pkg := base $.Config.Package }} diff --git a/entc/gen/template/example.tmpl b/entc/gen/template/example.tmpl index 591f084be..aa3c04251 100644 --- a/entc/gen/template/example.tmpl +++ b/entc/gen/template/example.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "example" }} {{ $pkg := base $.Config.Package }} diff --git a/entc/gen/template/header.tmpl b/entc/gen/template/header.tmpl index 0d49bd39e..d7fbad433 100644 --- a/entc/gen/template/header.tmpl +++ b/entc/gen/template/header.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "header" }} // {{ with $.Header }}{{ . }}{{ else }}Code generated by entc, DO NOT EDIT.{{ end }} diff --git a/entc/gen/template/import.tmpl b/entc/gen/template/import.tmpl index 510847f67..23765baa5 100644 --- a/entc/gen/template/import.tmpl +++ b/entc/gen/template/import.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "import" }} import ( "fmt" diff --git a/entc/gen/template/meta.tmpl b/entc/gen/template/meta.tmpl index 8b8cd08ba..7f2c2b089 100644 --- a/entc/gen/template/meta.tmpl +++ b/entc/gen/template/meta.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "meta" }} {{- with extend $ "Package" $.Package -}} diff --git a/entc/gen/template/migrate/migrate.tmpl b/entc/gen/template/migrate/migrate.tmpl index e45f4d2b6..1c58eb18e 100644 --- a/entc/gen/template/migrate/migrate.tmpl +++ b/entc/gen/template/migrate/migrate.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "migrate" }} {{- with extend $ "Package" "migrate" -}} diff --git a/entc/gen/template/migrate/schema.tmpl b/entc/gen/template/migrate/schema.tmpl index 1c8d980d4..bfb4ab423 100644 --- a/entc/gen/template/migrate/schema.tmpl +++ b/entc/gen/template/migrate/schema.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "schema" }} {{- with extend $ "Package" "migrate" -}} diff --git a/entc/gen/template/predicate.tmpl b/entc/gen/template/predicate.tmpl index dc5de6629..344485fed 100644 --- a/entc/gen/template/predicate.tmpl +++ b/entc/gen/template/predicate.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "predicate" }} {{- with extend $ "Package" "predicate" -}} diff --git a/entc/gen/template/tx.tmpl b/entc/gen/template/tx.tmpl index f96c659dc..199c3693b 100644 --- a/entc/gen/template/tx.tmpl +++ b/entc/gen/template/tx.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "tx" }} {{ template "header" $ }} diff --git a/entc/gen/template/where.tmpl b/entc/gen/template/where.tmpl index a884f0df0..a4da48a5c 100644 --- a/entc/gen/template/where.tmpl +++ b/entc/gen/template/where.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "where" }} {{- with extend $ "Package" $.Package -}} diff --git a/entc/load/template/main.tmpl b/entc/load/template/main.tmpl index 785336a38..3972b6f58 100644 --- a/entc/load/template/main.tmpl +++ b/entc/load/template/main.tmpl @@ -1,3 +1,9 @@ +{{/* +Copyright 2019-present Facebook Inc. All rights reserved. +This source code is licensed under the Apache 2.0 license found +in the LICENSE file in the root directory of this source tree. +*/}} + {{ define "main" }} // Code generated by 'entc generate'. DO NOT EDIT. package main