From fb7c376ba512ccac9e9346245c38c20407c91842 Mon Sep 17 00:00:00 2001
From: go-jet <47941548+go-jet@users.noreply.github.com>
Date: Sun, 16 Mar 2025 12:54:32 +0100
Subject: [PATCH 1/4] Update Readme.md (#464)
---
README.md | 579 ++++++------
examples/quick-start/dest.json | 1313 ---------------------------
examples/quick-start/dest2.json | 393 --------
examples/quick-start/quick-start.go | 4 +-
tests/postgres/select_test.go | 7 +-
tests/testdata | 2 +-
6 files changed, 322 insertions(+), 1976 deletions(-)
diff --git a/README.md b/README.md
index 70e29e9..2be1820 100644
--- a/README.md
+++ b/README.md
@@ -1,48 +1,64 @@
# Jet
+
+
[](https://app.circleci.com/pipelines/github/go-jet/jet?branch=master)
[](https://codecov.io/gh/go-jet/jet)
[](https://goreportcard.com/report/github.com/go-jet/jet/v2)
[](http://godoc.org/github.com/go-jet/jet/v2)
[](https://github.com/go-jet/jet/releases)
-Jet is a complete solution for efficient and high performance database access, consisting of type-safe SQL builder
-with code generation and automatic query result data mapping.
-Jet currently supports `PostgreSQL`, `MySQL`, `CockroachDB`, `MariaDB` and `SQLite`. Future releases will add support for additional databases.
+Jet is a complete solution for efficient and high performance database access, combining a type-safe SQL builder with code generation
+and automatic query result mapping.
+
+Jet currently supports the following database engines:
+
+* `PostgreSQL`
+* `MySQL`
+* `SQLite`
+
+This list is not exclusive, as many other databases implement compatible wire protocols. For example, `CockroachDB` uses the
+`PostgreSQL` wire protocol, and `MariaDB` is based on the `MySQL` protocol. Both databases are tested and known to work with Jet.
+
+Support for additional databases may be introduced in future releases.

-Jet is the easiest, and the fastest way to write complex type-safe SQL queries as a Go code and map database query result
-into complex object composition. __It is not an ORM.__
+Jet is the easiest, and the fastest way to write complex type-safe SQL queries as a Go code and map database query result
+into complex object composition.
-## Motivation
-https://medium.com/@go.jet/jet-5f3667efa0cc
+> [!Note]
+> Jet is __not__ an ORM.
## Contents
+- [Motivation](#motivation)
- [Features](#features)
- [Getting Started](#getting-started)
- - [Prerequisites](#prerequisites)
- - [Installation](#installation)
- - [Quick Start](#quick-start)
- - [Generate sql builder and model types](#generate-sql-builder-and-model-types)
- - [Lets write some SQL queries in Go](#lets-write-some-sql-queries-in-go)
- - [Execute query and store result](#execute-query-and-store-result)
+ - [Prerequisites](#prerequisites)
+ - [Installation](#installation)
+ - [Quick Start](#quick-start)
+ - [Generate sql builder and model types](#generate-sql-builder-and-model-types)
+ - [Lets write some SQL queries in Go](#lets-write-some-sql-queries-in-go)
+ - [Execute query and store result](#execute-query-and-store-result)
- [Benefits](#benefits)
- [Dependencies](#dependencies)
- [Versioning](#versioning)
- [License](#license)
+## Motivation
+https://medium.com/@go.jet/jet-5f3667efa0cc
+
## Features
- 1) Auto-generated type-safe SQL Builder. Statements supported:
- * [SELECT](https://github.com/go-jet/jet/wiki/SELECT) `(DISTINCT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT, OFFSET, FOR, LOCK_IN_SHARE_MODE, UNION, INTERSECT, EXCEPT, WINDOW, sub-queries)`
- * [INSERT](https://github.com/go-jet/jet/wiki/INSERT) `(VALUES, MODEL, MODELS, QUERY, ON_CONFLICT/ON_DUPLICATE_KEY_UPDATE, RETURNING)`,
- * [UPDATE](https://github.com/go-jet/jet/wiki/UPDATE) `(SET, MODEL, WHERE, RETURNING)`,
+1) Auto-generated type-safe SQL Builder. Statements supported:
+ * [SELECT](https://github.com/go-jet/jet/wiki/SELECT), [SELECT_JSON](https://github.com/go-jet/jet/wiki/SELECT_JSON-Statements) `(DISTINCT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT, OFFSET, FOR, LOCK_IN_SHARE_MODE, UNION, INTERSECT, EXCEPT, WINDOW, sub-queries)`
+ * [INSERT](https://github.com/go-jet/jet/wiki/INSERT) `(VALUES, MODEL, MODELS, QUERY, ON_CONFLICT/ON_DUPLICATE_KEY_UPDATE, RETURNING)`,
+ * [UPDATE](https://github.com/go-jet/jet/wiki/UPDATE) `(SET, MODEL, WHERE, RETURNING)`,
* [DELETE](https://github.com/go-jet/jet/wiki/DELETE) `(WHERE, ORDER_BY, LIMIT, RETURNING)`,
* [LOCK](https://github.com/go-jet/jet/wiki/LOCK) `(IN, NOWAIT)`, `(READ, WRITE)`
* [WITH](https://github.com/go-jet/jet/wiki/WITH)
-
- 2) Auto-generated Data Model types - Go types mapped to database type (table, view or enum), used to store
- result of database queries. Can be combined to create complex query result destination.
- 3) Query execution with result mapping to arbitrary destination.
+
+2) Auto-generated Data Model types - Go types mapped to database type (table, view or enum), used to store
+ result of database queries. Can be combined to create complex query result destination.
+3) Query execution with result mapping to arbitrary destination.
## Getting Started
@@ -50,7 +66,7 @@ https://medium.com/@go.jet/jet-5f3667efa0cc
To install Jet package, you need to install Go and set your Go workspace first.
-[Go](https://golang.org/) **version 1.18+ is required**
+[Go](https://golang.org/) **version 1.22+ is required**
### Installation
@@ -59,33 +75,35 @@ Use the command bellow to add jet as a dependency into `go.mod` project:
$ go get -u github.com/go-jet/jet/v2
```
-Jet generator can be installed in one of the following ways:
+Jet generator can be installed using one of the following methods:
-- (Go1.16+) Install jet generator using go install:
+- ✅ Option 1: Install via go install:
```sh
go install github.com/go-jet/jet/v2/cmd/jet@latest
```
-*Jet generator is installed to the directory named by the GOBIN environment variable,
-which defaults to $GOPATH/bin or $HOME/go/bin if the GOPATH environment variable is not set.*
-- Install jet generator to specific folder:
+> [!Tip]
+> Jet generator is installed to the directory named by the `GOBIN` environment variable,
+which defaults to `$GOPATH/bin` or `$HOME/go/bin` if the `GOPATH` environment variable is not set.
+
+- ✅ Option 2: Build manually from source and install jet generator to specific folder:
```sh
git clone https://github.com/go-jet/jet.git
-cd jet && go build -o dir_path ./cmd/jet
+cd jet && go build -o ./cmd/jet
```
-*Make sure `dir_path` folder is added to the PATH environment variable.*
-
+> [!Tip]
+> Make sure `target_directory` is included in your system’s `PATH` environment variable to allow global access to the jet command.
### Quick Start
For this quick start example we will use PostgreSQL sample _'dvd rental'_ database. Full database dump can be found in
[./tests/testdata/init/postgres/dvds.sql](https://github.com/go-jet/jet-test-data/blob/master/init/postgres/dvds.sql).
-Schema diagram of interest can be found [here](./examples/quick-start/diagram.png).
+A schema diagram illustrating the relevant part of the database is available [here](./examples/quick-start/diagram.png).
#### Generate SQL Builder and Model types
-To generate jet SQL Builder and Data Model types from running postgres database, we need to call `jet` generator with postgres
-connection parameters and destination folder path.
-Assuming we are running local postgres database, with user `user`, user password `pass`, database `jetdb` and
+To generate jet SQL Builder and Data Model types from running postgres database, we need to call `jet` generator with postgres
+connection parameters and destination folder path.
+Assuming we are running local postgres database, with user `user`, user password `pass`, database `jetdb` and
schema `dvds` we will use this command:
```sh
jet -dsn=postgresql://user:pass@localhost:5432/jetdb?sslmode=disable -schema=dvds -path=./.gen
@@ -93,7 +111,7 @@ jet -dsn=postgresql://user:pass@localhost:5432/jetdb?sslmode=disable -schema=dvd
```sh
Connecting to postgres database: postgresql://user:pass@localhost:5432/jetdb?sslmode=disable
Retrieving schema information...
- FOUND 15 table(s), 7 view(s), 1 enum(s)
+ FOUND 15 table(s), 7 view(s), 1 enum(s)
Cleaning up destination directory...
Generating table sql builder files...
Generating view sql builder files...
@@ -113,11 +131,10 @@ jet -dsn="file:///path/to/sqlite/database/file" -schema=dvds -path=./.gen
```
_*User has to have a permission to read information schema tables._
-As command output suggest, Jet will:
-- connect to postgres database and retrieve information about the _tables_, _views_ and _enums_ of `dvds` schema
-- delete everything in schema destination folder - `./.gen/jetdb/dvds`,
-- and finally generate SQL Builder and Model types for each schema table, view and enum.
-
+As indicated by the command output, Jet will perform the following actions:
+- ✅ Connect to the PostgreSQL database and retrieve metadata for all `tables`, `views`, and `enums` within the `dvds` schema.
+- ⚠️ **Delete all contents** in the target schema folder: `./.gen/jetdb/dvds`.
+- ⚙️ Generate **SQL Builder** and **Data Model** types for each table, view, and enum found in the schema.
Generated files folder structure will look like this:
```sh
@@ -141,9 +158,13 @@ Generated files folder structure will look like this:
| | |-- mpaa_rating.go
| | ...
```
-Types from `table`, `view` and `enum` are used to write type safe SQL in Go, and `model` types are combined to store
+
+Types from the `table`, `view`, and `enum` packages are used to write **type-safe SQL queries in Go**, while types from the `model` types are combined to store
results of the SQL queries.
+> [!Note]
+> It is possible to customize the default Jet generator behavior. All the aspects of generated SQLBuilder and model types
+> are customizable(see [wiki](https://github.com/go-jet/jet/wiki/Generator#generator-customization)).
#### Let's write some SQL queries in Go
@@ -151,16 +172,17 @@ results of the SQL queries.
First we need to import postgres SQLBuilder and generated packages from the previous step:
```go
import (
- // dot import so go code would resemble as much as native SQL
- // dot import is not mandatory
- . "github.com/go-jet/jet/v2/examples/quick-start/.gen/jetdb/dvds/table"
- . "github.com/go-jet/jet/v2/postgres"
+ // dot import so go code would resemble as much as native SQL
+ // dot import is not mandatory
+ . "github.com/go-jet/jet/v2/examples/quick-start/.gen/jetdb/dvds/table"
+ . "github.com/go-jet/jet/v2/postgres"
- "github.com/go-jet/jet/v2/examples/quick-start/.gen/jetdb/dvds/model"
+ "github.com/go-jet/jet/v2/examples/quick-start/.gen/jetdb/dvds/enum"
+ "github.com/go-jet/jet/v2/examples/quick-start/.gen/jetdb/dvds/model"
)
```
-Let's say we want to retrieve the list of all _actors_ that acted in _films_ longer than 180 minutes, _film language_ is 'English'
-and _film category_ is not 'Action'.
+Let's say we want to retrieve the list of all _actors_ who acted in _films_ longer than 180 minutes, _film language_ is 'English',
+_film category_ is not 'Action' and _film rating_ is not 'R'.
```golang
stmt := SELECT(
Actor.ActorID, Actor.FirstName, Actor.LastName, Actor.LastUpdate, // or just Actor.AllColumns
@@ -177,27 +199,30 @@ stmt := SELECT(
).WHERE(
Language.Name.EQ(Char(20)("English")).
AND(Category.Name.NOT_EQ(Text("Action"))).
- AND(Film.Length.GT(Int32(180))),
+ AND(Film.Length.GT(Int32(180))).
+ AND(Film.Rating.NOT_EQ(enum.MpaaRating.R)),
).ORDER_BY(
Actor.ActorID.ASC(),
Film.FilmID.ASC(),
)
```
-_Package(dot) import is used, so the statements look as close as possible to the native SQL._
-Note that every column has a type. String column `Language.Name` and `Category.Name` can be compared only with
-string columns and expressions. `Actor.ActorID`, `FilmActor.ActorID`, `Film.Length` are integer columns
-and can be compared only with integer columns and expressions.
+> [!Tip]
+> Package(dot) import is used, so the statements look as close as possible to the native SQL.
-__How to get a parametrized SQL query from the statement?__
+Note that every column has a type. String columns, such as `Language.Name` and `Category.Name` can only be compared with
+string columns and expressions. Similarity, `Actor.ActorID`, `FilmActor.ActorID`, `Film.Length` are integer columns
+and can only be compared with integer columns and expressions.
+
+__How to Get a Parametrized SQL Query from the Statement?__
```go
query, args := stmt.Sql()
```
query - parametrized query
-args - query parameters
+args - query arguments
Click to see `query` and `args`
-
+
```sql
SELECT actor.actor_id AS "actor.actor_id",
actor.first_name AS "actor.first_name",
@@ -228,7 +253,7 @@ FROM dvds.actor
INNER JOIN dvds.language ON (language.language_id = film.language_id)
INNER JOIN dvds.film_category ON (film_category.film_id = film.film_id)
INNER JOIN dvds.category ON (category.category_id = film_category.category_id)
-WHERE ((language.name = $1::char(20)) AND (category.name != $2::text)) AND (film.length > $3::integer)
+WHERE (((language.name = $1::char(20)) AND (category.name != $2::text)) AND (film.length > $3)) AND (film.rating != 'R')
ORDER BY actor.actor_id ASC, film.film_id ASC;
```
```sh
@@ -237,16 +262,18 @@ ORDER BY actor.actor_id ASC, film.film_id ASC;
-
-__How to get debug SQL from statement?__
+
+__How to Get Debug SQL from Statement?__
```go
debugSql := stmt.DebugSql()
```
-debugSql - this query string can be copy-pasted to sql editor and executed. __It is not intended to be used in production. For debug purposes only!!!__
+debugSql - this query string can be copy-pasted into sql editor and executed.
+> [!Warning]
+> Debug SQL is not intended to be used in production. For debug purposes only!!!
Click to see debug sql
-
+
```sql
SELECT actor.actor_id AS "actor.actor_id",
actor.first_name AS "actor.first_name",
@@ -277,25 +304,22 @@ FROM dvds.actor
INNER JOIN dvds.language ON (language.language_id = film.language_id)
INNER JOIN dvds.film_category ON (film_category.film_id = film.film_id)
INNER JOIN dvds.category ON (category.category_id = film_category.category_id)
-WHERE ((language.name = 'English'::char(20)) AND (category.name != 'Action'::text)) AND (film.length > 180::integer)
+WHERE (((language.name = 'English'::char(20)) AND (category.name != 'Action'::text)) AND (film.length > 180)) AND (film.rating != 'R')
ORDER BY actor.actor_id ASC, film.film_id ASC;
```
-#### Execute query and store result
+#### Execute Query and Store Result
-Well-formed SQL is just a first half of the job. Let's see how can we make some sense of result set returned executing
+Well-formed SQL is just a first half of the job. Let's see how can we make some sense of result set returned executing
above statement. Usually this is the most complex and tedious work, but with Jet it is the easiest.
-First we have to create desired structure to store query result.
-This is done be combining autogenerated model types, or it can be done
-by combining custom model types(see [wiki](https://github.com/go-jet/jet/wiki/Query-Result-Mapping-(QRM)#custom-model-types) for more information).
+First, we need to define the structure in which to store the query result. This
+can be achieved by combining autogenerated model types, or by using custom
+model types(see [wiki](https://github.com/go-jet/jet/wiki/Query-Result-Mapping-(QRM)#custom-model-types) for more information).
-_Note that it's possible to overwrite default jet generator behavior. All the aspects of generated model and SQLBuilder types can be
-tailor-made([wiki](https://github.com/go-jet/jet/wiki/Generator#generator-customization))._
-
-Let's say this is our desired structure made of autogenerated types:
+Let's say this is our desired structure made of autogenerated types:
```go
var dest []struct {
model.Actor
@@ -308,11 +332,17 @@ var dest []struct {
}
}
```
-`Films` field is a slice because one actor can act in multiple films, and because each film belongs to one language
-`Langauge` field is just a single model struct. `Film` can belong to multiple categories.
-_*There is no limitation of how big or nested destination can be._
-Now let's execute above statement on open database connection (or transaction) db and store result into `dest`.
+The `Films` field is a slice because an actor can appear in multiple films,
+and each film is associated with a single language. The `Language` field,
+on the other hand, is a single model struct. A `Film` can belong to multiple
+categories.
+
+> [!Note]
+> There is no limitation of how big or nested destination can be.
+
+Now, let's execute the above statement on an open database connection (or
+transaction) `db` and store the result in the `dest` variable.
```go
err := stmt.Query(db, &dest)
@@ -320,11 +350,18 @@ handleError(err)
```
__And that's it.__
-
-`dest` now contains the list of all actors(with list of films acted, where each film has information about language and list of belonging categories) that acted in films longer than 180 minutes, film language is 'English'
-and film category is not 'Action'.
-Lets print `dest` as a json to see:
+The `dest` variable now contains a list of all actors (each with a list of
+films they acted in). Each film includes information about its language and
+a list of categories it belongs to. This list is filtered to include only
+films longer than 180 minutes, where the film language is 'English', and
+the film category is not 'Action'.
+
+> [!Tip]
+> It is recommended to enable **Strict Scan** on application startup, especially when destination contains
+> custom model types. For more details, see the [wiki](https://github.com/go-jet/jet/wiki/Query-Result-Mapping-(QRM)#strict-scan).
+
+Lets print `dest` as a JSON to see:
```go
jsonText, _ := json.MarshalIndent(dest, "", "\t")
fmt.Println(string(jsonText))
@@ -332,81 +369,81 @@ fmt.Println(string(jsonText))
```js
[
- {
- "ActorID": 1,
- "FirstName": "Penelope",
- "LastName": "Guiness",
- "LastUpdate": "2013-05-26T14:47:57.62Z",
- "Films": [
- {
- "FilmID": 499,
- "Title": "King Evolution",
- "Description": "A Action-Packed Tale of a Boy And a Lumberjack who must Chase a Madman in A Baloon",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 3,
- "RentalRate": 4.99,
- "Length": 184,
- "ReplacementCost": 24.99,
- "Rating": "NC-17",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,\"Deleted Scenes\",\"Behind the Scenes\"}",
- "Fulltext": "'action':5 'action-pack':4 'baloon':21 'boy':10 'chase':16 'evolut':2 'king':1 'lumberjack':13 'madman':18 'must':15 'pack':6 'tale':7",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 8,
- "Name": "Family",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- }
- ]
- },
- {
- "ActorID": 3,
- "FirstName": "Ed",
- "LastName": "Chase",
- "LastUpdate": "2013-05-26T14:47:57.62Z",
- "Films": [
- {
- "FilmID": 996,
- "Title": "Young Language",
- "Description": "A Unbelieveable Yarn of a Boat And a Database Administrator who must Meet a Boy in The First Manned Space Station",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 6,
- "RentalRate": 0.99,
- "Length": 183,
- "ReplacementCost": 9.99,
- "Rating": "G",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,\"Behind the Scenes\"}",
- "Fulltext": "'administr':12 'boat':8 'boy':17 'databas':11 'first':20 'languag':2 'man':21 'meet':15 'must':14 'space':22 'station':23 'unbeliev':4 'yarn':5 'young':1",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 6,
- "Name": "Documentary",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- }
- ]
- },
- //...(125 more items)
+ {
+ "ActorID": 1,
+ "FirstName": "Penelope",
+ "LastName": "Guiness",
+ "LastUpdate": "2013-05-26T14:47:57.62Z",
+ "Films": [
+ {
+ "FilmID": 499,
+ "Title": "King Evolution",
+ "Description": "A Action-Packed Tale of a Boy And a Lumberjack who must Chase a Madman in A Baloon",
+ "ReleaseYear": 2006,
+ "LanguageID": 1,
+ "RentalDuration": 3,
+ "RentalRate": 4.99,
+ "Length": 184,
+ "ReplacementCost": 24.99,
+ "Rating": "NC-17",
+ "LastUpdate": "2013-05-26T14:50:58.951Z",
+ "SpecialFeatures": "{Trailers,\"Deleted Scenes\",\"Behind the Scenes\"}",
+ "Fulltext": "'action':5 'action-pack':4 'baloon':21 'boy':10 'chase':16 'evolut':2 'king':1 'lumberjack':13 'madman':18 'must':15 'pack':6 'tale':7",
+ "Language": {
+ "LanguageID": 1,
+ "Name": "English ",
+ "LastUpdate": "0001-01-01T00:00:00Z"
+ },
+ "Categories": [
+ {
+ "CategoryID": 8,
+ "Name": "Family",
+ "LastUpdate": "2006-02-15T09:46:27Z"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ActorID": 3,
+ "FirstName": "Ed",
+ "LastName": "Chase",
+ "LastUpdate": "2013-05-26T14:47:57.62Z",
+ "Films": [
+ {
+ "FilmID": 996,
+ "Title": "Young Language",
+ "Description": "A Unbelieveable Yarn of a Boat And a Database Administrator who must Meet a Boy in The First Manned Space Station",
+ "ReleaseYear": 2006,
+ "LanguageID": 1,
+ "RentalDuration": 6,
+ "RentalRate": 0.99,
+ "Length": 183,
+ "ReplacementCost": 9.99,
+ "Rating": "G",
+ "LastUpdate": "2013-05-26T14:50:58.951Z",
+ "SpecialFeatures": "{Trailers,\"Behind the Scenes\"}",
+ "Fulltext": "'administr':12 'boat':8 'boy':17 'databas':11 'first':20 'languag':2 'man':21 'meet':15 'must':14 'space':22 'station':23 'unbeliev':4 'yarn':5 'young':1",
+ "Language": {
+ "LanguageID": 1,
+ "Name": "English ",
+ "LastUpdate": "0001-01-01T00:00:00Z"
+ },
+ "Categories": [
+ {
+ "CategoryID": 6,
+ "Name": "Documentary",
+ "LastUpdate": "2006-02-15T09:46:27Z"
+ }
+ ]
+ }
+ ]
+ },
+ //...(125 more items)
]
```
-What if, we also want to have list of films per category and actors per category, where films are longer than 180 minutes, film language is 'English'
+What if, we also want to have list of films per category and actors per category, where films are longer than 180 minutes, film language is 'English'
and film category is not 'Action'.
In that case we can reuse above statement `stmt`, and just change our destination:
@@ -426,87 +463,87 @@ handleError(err)
```js
[
- {
- "CategoryID": 8,
- "Name": "Family",
- "LastUpdate": "2006-02-15T09:46:27Z",
- "Films": [
- {
- "FilmID": 499,
- "Title": "King Evolution",
- "Description": "A Action-Packed Tale of a Boy And a Lumberjack who must Chase a Madman in A Baloon",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 3,
- "RentalRate": 4.99,
- "Length": 184,
- "ReplacementCost": 24.99,
- "Rating": "NC-17",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,\"Deleted Scenes\",\"Behind the Scenes\"}",
- "Fulltext": "'action':5 'action-pack':4 'baloon':21 'boy':10 'chase':16 'evolut':2 'king':1 'lumberjack':13 'madman':18 'must':15 'pack':6 'tale':7"
- },
- {
- "FilmID": 50,
- "Title": "Baked Cleopatra",
- "Description": "A Stunning Drama of a Forensic Psychologist And a Husband who must Overcome a Waitress in A Monastery",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 3,
- "RentalRate": 2.99,
- "Length": 182,
- "ReplacementCost": 20.99,
- "Rating": "G",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Commentaries,\"Behind the Scenes\"}",
- "Fulltext": "'bake':1 'cleopatra':2 'drama':5 'forens':8 'husband':12 'monasteri':20 'must':14 'overcom':15 'psychologist':9 'stun':4 'waitress':17"
- }
- ],
- "Actors": [
- {
- "ActorID": 1,
- "FirstName": "Penelope",
- "LastName": "Guiness",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 20,
- "FirstName": "Lucille",
- "LastName": "Tracy",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 36,
- "FirstName": "Burt",
- "LastName": "Dukakis",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 70,
- "FirstName": "Michelle",
- "LastName": "Mcconaughey",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 118,
- "FirstName": "Cuba",
- "LastName": "Allen",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 187,
- "FirstName": "Renee",
- "LastName": "Ball",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 198,
- "FirstName": "Mary",
- "LastName": "Keitel",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- }
- ]
- },
+ {
+ "CategoryID": 8,
+ "Name": "Family",
+ "LastUpdate": "2006-02-15T09:46:27Z",
+ "Films": [
+ {
+ "FilmID": 499,
+ "Title": "King Evolution",
+ "Description": "A Action-Packed Tale of a Boy And a Lumberjack who must Chase a Madman in A Baloon",
+ "ReleaseYear": 2006,
+ "LanguageID": 1,
+ "RentalDuration": 3,
+ "RentalRate": 4.99,
+ "Length": 184,
+ "ReplacementCost": 24.99,
+ "Rating": "NC-17",
+ "LastUpdate": "2013-05-26T14:50:58.951Z",
+ "SpecialFeatures": "{Trailers,\"Deleted Scenes\",\"Behind the Scenes\"}",
+ "Fulltext": "'action':5 'action-pack':4 'baloon':21 'boy':10 'chase':16 'evolut':2 'king':1 'lumberjack':13 'madman':18 'must':15 'pack':6 'tale':7"
+ },
+ {
+ "FilmID": 50,
+ "Title": "Baked Cleopatra",
+ "Description": "A Stunning Drama of a Forensic Psychologist And a Husband who must Overcome a Waitress in A Monastery",
+ "ReleaseYear": 2006,
+ "LanguageID": 1,
+ "RentalDuration": 3,
+ "RentalRate": 2.99,
+ "Length": 182,
+ "ReplacementCost": 20.99,
+ "Rating": "G",
+ "LastUpdate": "2013-05-26T14:50:58.951Z",
+ "SpecialFeatures": "{Commentaries,\"Behind the Scenes\"}",
+ "Fulltext": "'bake':1 'cleopatra':2 'drama':5 'forens':8 'husband':12 'monasteri':20 'must':14 'overcom':15 'psychologist':9 'stun':4 'waitress':17"
+ }
+ ],
+ "Actors": [
+ {
+ "ActorID": 1,
+ "FirstName": "Penelope",
+ "LastName": "Guiness",
+ "LastUpdate": "2013-05-26T14:47:57.62Z"
+ },
+ {
+ "ActorID": 20,
+ "FirstName": "Lucille",
+ "LastName": "Tracy",
+ "LastUpdate": "2013-05-26T14:47:57.62Z"
+ },
+ {
+ "ActorID": 36,
+ "FirstName": "Burt",
+ "LastName": "Dukakis",
+ "LastUpdate": "2013-05-26T14:47:57.62Z"
+ },
+ {
+ "ActorID": 70,
+ "FirstName": "Michelle",
+ "LastName": "Mcconaughey",
+ "LastUpdate": "2013-05-26T14:47:57.62Z"
+ },
+ {
+ "ActorID": 118,
+ "FirstName": "Cuba",
+ "LastName": "Allen",
+ "LastUpdate": "2013-05-26T14:47:57.62Z"
+ },
+ {
+ "ActorID": 187,
+ "FirstName": "Renee",
+ "LastName": "Ball",
+ "LastUpdate": "2013-05-26T14:47:57.62Z"
+ },
+ {
+ "ActorID": 198,
+ "FirstName": "Mary",
+ "LastName": "Keitel",
+ "LastUpdate": "2013-05-26T14:47:57.62Z"
+ }
+ ]
+ },
//...
]
```
@@ -515,7 +552,7 @@ handleError(err)
Complete code example can be found at [./examples/quick-start/quick-start.go](./examples/quick-start/quick-start.go)
-This example represent probably the most common use case. Detail info about additional statements, features and use cases can be
+This example represent probably the most common use case. Detail info about additional statements, features and use cases can be
found at project [Wiki](https://github.com/go-jet/jet/wiki) page.
## Benefits
@@ -523,59 +560,71 @@ found at project [Wiki](https://github.com/go-jet/jet/wiki) page.
What are the benefits of writing SQL in Go using Jet?
The biggest benefit is speed. Speed is being improved in 3 major areas:
-##### Speed of development
+##### Speed of Development
-Writing SQL queries is faster and easier, as developers will have help of SQL code completion and SQL type safety directly from Go code.
-Automatic scan to arbitrary structure removes a lot of headache and boilerplate code needed to structure database query result.
+Writing SQL queries becomes faster and more efficient, as developers benefit
+from SQL code completion and type safety directly within Go code. Automatic
+scanning to arbitrary structures eliminates much of the headache and boilerplate required
+to structure database query results, reducing both complexity and development time.
-##### Speed of execution
+##### Speed of Execution
-While ORM libraries can introduce significant performance penalties due to number of round-trips to the database(N+1 query problem),
-`jet` will always perform better as developers can write complex query and retrieve result with a single database call.
-Thus handler time lost on latency between server and database can be constant. Handler execution will be proportional
-only to the query complexity and the number of rows returned from database.
+While ORM libraries can introduce significant performance penalties when
+multiple tables are involved, due to multiple round-trips to the database
+(i.e., the `N+1` query problem), Jet will always perform better. Developers
+can write queries of any complexity and retrieve results with a single database call.
+As a result, handler time lost to latency between the server and database
+remains constant. Handler execution time is proportional only to query
+complexity and the number of rows returned from the database.
-With Jet, it is even possible to join the whole database and store the whole structured result in one database call.
-This is exactly what is being done in one of the tests: [TestJoinEverything](https://github.com/go-jet/jet/blob/6706f4b228f51cf810129f57ba90bbdb60b85fe7/tests/postgres/chinook_db_test.go#L187).
-The whole test database is joined and query result(~10,000 rows) is stored in a structured variable in less than 0.5s.
+> [!Tip]
+> As of the version `v2.13.0`, developers can leverage [SELECT_JSON](https://github.com/go-jet/jet/wiki/SELECT_JSON-Statements)
+> statements to encode query result as JSON on the SQL server, and then return that JSON as a result. Instead of
+> returning a large set of rows, the query now returns a single row with one column containing the entire result as JSON,
+> further reducing latency.
-##### How quickly bugs are found
+With Jet, it is even possible to join the whole database and store the whole structured result in one database call.
+This is exactly what is being done in one of the tests: [TestJoinEverything](https://github.com/go-jet/jet/blob/6706f4b228f51cf810129f57ba90bbdb60b85fe7/tests/postgres/chinook_db_test.go#L187).
+The whole test database is joined and query result(~10,000 rows and 68 columns) is stored in a structured variable in less than 0.5s, or
+in case of `SELECT_JSON` statement in around 0.3s.
-The most expensive bugs are the one discovered on the production, and the least expensive are those found during development.
-With automatically generated type safe SQL, not only queries are written faster but bugs are found sooner.
-Let's return to quick start example, and take closer look at a line:
+##### How Quickly Bugs are Found
+
+The most expensive bugs are those discovered in production, while the least expensive are those found during development.
+With automatically generated, type-safe SQL, queries are not only written faster but bugs are caught sooner.
+
+Consider the following line from the quick start example:
```go
AND(Film.Length.GT(Int32(180))),
```
-Let's say someone changes column `length` to `duration` from `film` table. The next go build will fail at that line, and
+Let's say someone changes column `length` to `duration` from `film` table. The next go build will fail at that line, and
the bug will be caught at compile time.
Let's say someone changes the type of `length` column to some non-integer type. Build will also fail at the same line
because integer columns and expressions can be only compared to other integer columns and expressions.
-Build will also fail if someone removes `length` column from `film` table. `Film` field will be omitted from SQL Builder and Model types,
+Build will also fail if someone removes `length` column from `film` table. `Film` field will be omitted from SQL Builder and Model types,
next time `jet` generator is run.
-Without Jet these bugs will have to be either caught by tests or by manual testing.
+Without Jet these bugs will have to be either caught by tests or by manual testing.
## Dependencies
-At the moment Jet dependence only of:
-- `github.com/lib/pq` _(Used by jet generator to read `PostgreSQL` database information)_
-- `github.com/go-sql-driver/mysql` _(Used by jet generator to read `MySQL` and `MariaDB` database information)_
-- `github.com/mattn/go-sqlite3` _(Used by jet generator to read `SQLite` database information)_
-- `github.com/google/uuid` _(Used in data model files and for debug purposes)_
-
-To run the tests, additional dependencies are required:
-- `github.com/pkg/profile`
-- `github.com/stretchr/testify`
-- `github.com/google/go-cmp`
-- `github.com/jackc/pgx/v4`
-- `github.com/shopspring/decimal`
-- `github.com/volatiletech/null/v8`
+
+To execute Jet SQL statements, **ANY** SQL driver that implements Go's standard `database/sql` interface can be used.
+
+By default, the `Jet` generator executable uses the following SQL drivers to read database schema information:
+- `github.com/lib/pq` _(`PostgreSQL` and `CockroachDB` )_
+- `github.com/go-sql-driver/mysql` _(`MySQL` and `MariaDB`)_
+- `github.com/mattn/go-sqlite3` _(`SQLite`)_
+
+The default SQL driver used by the Jet generator can be replaced, if needed, by
+[customizing the generator](https://github.com/go-jet/jet/wiki/Generator#generator-customization).
## Versioning
-[SemVer](http://semver.org/) is used for versioning. For the versions available, take a look at the [releases](https://github.com/go-jet/jet/releases).
+[SemVer](http://semver.org/) is used for versioning. For the versions available, take a look at the [releases](https://github.com/go-jet/jet/releases).
+
+Typically, two releases are published each year — one in early spring and another in late autumn.
## License
diff --git a/examples/quick-start/dest.json b/examples/quick-start/dest.json
index d23e588..900760d 100644
--- a/examples/quick-start/dest.json
+++ b/examples/quick-start/dest.json
@@ -137,60 +137,6 @@
}
]
},
- {
- "FilmID": 535,
- "Title": "Love Suicides",
- "Description": "A Brilliant Panorama of a Hunter And a Explorer who must Pursue a Dentist in An Abandoned Fun House",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 6,
- "RentalRate": 0.99,
- "Length": 181,
- "ReplacementCost": 21.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,\"Behind the Scenes\"}",
- "Fulltext": "'abandon':19 'brilliant':4 'dentist':16 'explor':11 'fun':20 'hous':21 'hunter':8 'love':1 'must':13 'panorama':5 'pursu':14 'suicid':2",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 11,
- "Name": "Horror",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- },
- {
- "FilmID": 817,
- "Title": "Soldiers Evolution",
- "Description": "A Lacklusture Panorama of a A Shark And a Pioneer who must Confront a Student in The First Manned Space Station",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 7,
- "RentalRate": 4.99,
- "Length": 185,
- "ReplacementCost": 27.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,Commentaries,\"Deleted Scenes\",\"Behind the Scenes\"}",
- "Fulltext": "'confront':15 'evolut':2 'first':20 'lacklustur':4 'man':21 'must':14 'panorama':5 'pioneer':12 'shark':9 'soldier':1 'space':22 'station':23 'student':17",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 14,
- "Name": "Sci-Fi",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- },
{
"FilmID": 841,
"Title": "Star Operation",
@@ -252,33 +198,6 @@
"LastUpdate": "2006-02-15T09:46:27Z"
}
]
- },
- {
- "FilmID": 974,
- "Title": "Wild Apollo",
- "Description": "A Beautiful Story of a Monkey And a Sumo Wrestler who must Conquer a A Shark in A MySQL Convention",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 4,
- "RentalRate": 0.99,
- "Length": 181,
- "ReplacementCost": 24.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,Commentaries,\"Deleted Scenes\",\"Behind the Scenes\"}",
- "Fulltext": "'apollo':2 'beauti':4 'conquer':15 'convent':22 'monkey':8 'must':14 'mysql':21 'shark':18 'stori':5 'sumo':11 'wild':1 'wrestler':12",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 13,
- "Name": "New",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
}
]
},
@@ -349,33 +268,6 @@
"LastUpdate": "2006-02-15T09:46:27Z"
}
]
- },
- {
- "FilmID": 817,
- "Title": "Soldiers Evolution",
- "Description": "A Lacklusture Panorama of a A Shark And a Pioneer who must Confront a Student in The First Manned Space Station",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 7,
- "RentalRate": 4.99,
- "Length": 185,
- "ReplacementCost": 27.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,Commentaries,\"Deleted Scenes\",\"Behind the Scenes\"}",
- "Fulltext": "'confront':15 'evolut':2 'first':20 'lacklustur':4 'man':21 'must':14 'panorama':5 'pioneer':12 'shark':9 'soldier':1 'space':22 'station':23 'student':17",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 14,
- "Name": "Sci-Fi",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
}
]
},
@@ -385,33 +277,6 @@
"LastName": "Olivier",
"LastUpdate": "2013-05-26T14:47:57.62Z",
"Films": [
- {
- "FilmID": 817,
- "Title": "Soldiers Evolution",
- "Description": "A Lacklusture Panorama of a A Shark And a Pioneer who must Confront a Student in The First Manned Space Station",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 7,
- "RentalRate": 4.99,
- "Length": 185,
- "ReplacementCost": 27.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,Commentaries,\"Deleted Scenes\",\"Behind the Scenes\"}",
- "Fulltext": "'confront':15 'evolut':2 'first':20 'lacklustur':4 'man':21 'must':14 'panorama':5 'pioneer':12 'shark':9 'soldier':1 'space':22 'station':23 'student':17",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 14,
- "Name": "Sci-Fi",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- },
{
"FilmID": 886,
"Title": "Theory Mermaid",
@@ -600,41 +465,6 @@
}
]
},
- {
- "ActorID": 21,
- "FirstName": "Kirsten",
- "LastName": "Paltrow",
- "LastUpdate": "2013-05-26T14:47:57.62Z",
- "Films": [
- {
- "FilmID": 426,
- "Title": "Home Pity",
- "Description": "A Touching Panorama of a Man And a Secret Agent who must Challenge a Teacher in A MySQL Convention",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 7,
- "RentalRate": 4.99,
- "Length": 185,
- "ReplacementCost": 15.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,Commentaries,\"Behind the Scenes\"}",
- "Fulltext": "'agent':12 'challeng':15 'convent':21 'home':1 'man':8 'must':14 'mysql':20 'panorama':5 'piti':2 'secret':11 'teacher':17 'touch':4",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 12,
- "Name": "Music",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- }
- ]
- },
{
"ActorID": 22,
"FirstName": "Elvis",
@@ -961,74 +791,12 @@
}
]
},
- {
- "ActorID": 35,
- "FirstName": "Judy",
- "LastName": "Dean",
- "LastUpdate": "2013-05-26T14:47:57.62Z",
- "Films": [
- {
- "FilmID": 817,
- "Title": "Soldiers Evolution",
- "Description": "A Lacklusture Panorama of a A Shark And a Pioneer who must Confront a Student in The First Manned Space Station",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 7,
- "RentalRate": 4.99,
- "Length": 185,
- "ReplacementCost": 27.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,Commentaries,\"Deleted Scenes\",\"Behind the Scenes\"}",
- "Fulltext": "'confront':15 'evolut':2 'first':20 'lacklustur':4 'man':21 'must':14 'panorama':5 'pioneer':12 'shark':9 'soldier':1 'space':22 'station':23 'student':17",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 14,
- "Name": "Sci-Fi",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- }
- ]
- },
{
"ActorID": 36,
"FirstName": "Burt",
"LastName": "Dukakis",
"LastUpdate": "2013-05-26T14:47:57.62Z",
"Films": [
- {
- "FilmID": 426,
- "Title": "Home Pity",
- "Description": "A Touching Panorama of a Man And a Secret Agent who must Challenge a Teacher in A MySQL Convention",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 7,
- "RentalRate": 4.99,
- "Length": 185,
- "ReplacementCost": 15.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,Commentaries,\"Behind the Scenes\"}",
- "Fulltext": "'agent':12 'challeng':15 'convent':21 'home':1 'man':8 'must':14 'mysql':20 'panorama':5 'piti':2 'secret':11 'teacher':17 'touch':4",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 12,
- "Name": "Music",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- },
{
"FilmID": 499,
"Title": "King Evolution",
@@ -1093,41 +861,6 @@
}
]
},
- {
- "ActorID": 38,
- "FirstName": "Tom",
- "LastName": "Mckellen",
- "LastUpdate": "2013-05-26T14:47:57.62Z",
- "Films": [
- {
- "FilmID": 24,
- "Title": "Analyze Hoosiers",
- "Description": "A Thoughtful Display of a Explorer And a Pastry Chef who must Overcome a Feminist in The Sahara Desert",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 6,
- "RentalRate": 2.99,
- "Length": 181,
- "ReplacementCost": 19.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,\"Behind the Scenes\"}",
- "Fulltext": "'analyz':1 'chef':12 'desert':21 'display':5 'explor':8 'feminist':17 'hoosier':2 'must':14 'overcom':15 'pastri':11 'sahara':20 'thought':4",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 11,
- "Name": "Horror",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- }
- ]
- },
{
"ActorID": 40,
"FirstName": "Johnny",
@@ -1198,68 +931,6 @@
}
]
},
- {
- "ActorID": 42,
- "FirstName": "Tom",
- "LastName": "Miranda",
- "LastUpdate": "2013-05-26T14:47:57.62Z",
- "Films": [
- {
- "FilmID": 24,
- "Title": "Analyze Hoosiers",
- "Description": "A Thoughtful Display of a Explorer And a Pastry Chef who must Overcome a Feminist in The Sahara Desert",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 6,
- "RentalRate": 2.99,
- "Length": 181,
- "ReplacementCost": 19.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,\"Behind the Scenes\"}",
- "Fulltext": "'analyz':1 'chef':12 'desert':21 'display':5 'explor':8 'feminist':17 'hoosier':2 'must':14 'overcom':15 'pastri':11 'sahara':20 'thought':4",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 11,
- "Name": "Horror",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- },
- {
- "FilmID": 535,
- "Title": "Love Suicides",
- "Description": "A Brilliant Panorama of a Hunter And a Explorer who must Pursue a Dentist in An Abandoned Fun House",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 6,
- "RentalRate": 0.99,
- "Length": 181,
- "ReplacementCost": 21.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,\"Behind the Scenes\"}",
- "Fulltext": "'abandon':19 'brilliant':4 'dentist':16 'explor':11 'fun':20 'hous':21 'hunter':8 'love':1 'must':13 'panorama':5 'pursu':14 'suicid':2",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 11,
- "Name": "Horror",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- }
- ]
- },
{
"ActorID": 43,
"FirstName": "Kirk",
@@ -1586,41 +1257,6 @@
}
]
},
- {
- "ActorID": 51,
- "FirstName": "Gary",
- "LastName": "Phoenix",
- "LastUpdate": "2013-05-26T14:47:57.62Z",
- "Films": [
- {
- "FilmID": 974,
- "Title": "Wild Apollo",
- "Description": "A Beautiful Story of a Monkey And a Sumo Wrestler who must Conquer a A Shark in A MySQL Convention",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 4,
- "RentalRate": 0.99,
- "Length": 181,
- "ReplacementCost": 24.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,Commentaries,\"Deleted Scenes\",\"Behind the Scenes\"}",
- "Fulltext": "'apollo':2 'beauti':4 'conquer':15 'convent':22 'monkey':8 'must':14 'mysql':21 'shark':18 'stori':5 'sumo':11 'wild':1 'wrestler':12",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 13,
- "Name": "New",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- }
- ]
- },
{
"ActorID": 54,
"FirstName": "Penelope",
@@ -1785,33 +1421,6 @@
"LastUpdate": "2006-02-15T09:46:27Z"
}
]
- },
- {
- "FilmID": 426,
- "Title": "Home Pity",
- "Description": "A Touching Panorama of a Man And a Secret Agent who must Challenge a Teacher in A MySQL Convention",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 7,
- "RentalRate": 4.99,
- "Length": 185,
- "ReplacementCost": 15.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,Commentaries,\"Behind the Scenes\"}",
- "Fulltext": "'agent':12 'challeng':15 'convent':21 'home':1 'man':8 'must':14 'mysql':20 'panorama':5 'piti':2 'secret':11 'teacher':17 'touch':4",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 12,
- "Name": "Music",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
}
]
},
@@ -1821,33 +1430,6 @@
"LastName": "Neeson",
"LastUpdate": "2013-05-26T14:47:57.62Z",
"Films": [
- {
- "FilmID": 535,
- "Title": "Love Suicides",
- "Description": "A Brilliant Panorama of a Hunter And a Explorer who must Pursue a Dentist in An Abandoned Fun House",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 6,
- "RentalRate": 0.99,
- "Length": 181,
- "ReplacementCost": 21.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,\"Behind the Scenes\"}",
- "Fulltext": "'abandon':19 'brilliant':4 'dentist':16 'explor':11 'fun':20 'hous':21 'hunter':8 'love':1 'must':13 'panorama':5 'pursu':14 'suicid':2",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 11,
- "Name": "Horror",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- },
{
"FilmID": 767,
"Title": "Scalawag Duck",
@@ -1910,33 +1492,6 @@
}
]
},
- {
- "FilmID": 406,
- "Title": "Haunting Pianist",
- "Description": "A Fast-Paced Story of a Database Administrator And a Composer who must Defeat a Squirrel in An Abandoned Amusement Park",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 5,
- "RentalRate": 0.99,
- "Length": 181,
- "ReplacementCost": 22.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{\"Behind the Scenes\"}",
- "Fulltext": "'abandon':22 'administr':11 'amus':23 'compos':14 'databas':10 'defeat':17 'fast':5 'fast-pac':4 'haunt':1 'must':16 'pace':6 'park':24 'pianist':2 'squirrel':19 'stori':7",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 10,
- "Name": "Games",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- },
{
"FilmID": 719,
"Title": "Records Zorro",
@@ -2001,41 +1556,6 @@
}
]
},
- {
- "ActorID": 67,
- "FirstName": "Jessica",
- "LastName": "Bailey",
- "LastUpdate": "2013-05-26T14:47:57.62Z",
- "Films": [
- {
- "FilmID": 24,
- "Title": "Analyze Hoosiers",
- "Description": "A Thoughtful Display of a Explorer And a Pastry Chef who must Overcome a Feminist in The Sahara Desert",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 6,
- "RentalRate": 2.99,
- "Length": 181,
- "ReplacementCost": 19.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,\"Behind the Scenes\"}",
- "Fulltext": "'analyz':1 'chef':12 'desert':21 'display':5 'explor':8 'feminist':17 'hoosier':2 'must':14 'overcom':15 'pastri':11 'sahara':20 'thought':4",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 11,
- "Name": "Horror",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- }
- ]
- },
{
"ActorID": 68,
"FirstName": "Rip",
@@ -2176,76 +1696,6 @@
}
]
},
- {
- "ActorID": 74,
- "FirstName": "Milla",
- "LastName": "Keitel",
- "LastUpdate": "2013-05-26T14:47:57.62Z",
- "Films": [
- {
- "FilmID": 872,
- "Title": "Sweet Brotherhood",
- "Description": "A Unbelieveable Epistle of a Sumo Wrestler And a Hunter who must Chase a Forensic Psychologist in A Baloon",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 3,
- "RentalRate": 2.99,
- "Length": 185,
- "ReplacementCost": 27.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{\"Deleted Scenes\"}",
- "Fulltext": "'baloon':21 'brotherhood':2 'chase':15 'epistl':5 'forens':17 'hunter':12 'must':14 'psychologist':18 'sumo':8 'sweet':1 'unbeliev':4 'wrestler':9",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 16,
- "Name": "Travel",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- }
- ]
- },
- {
- "ActorID": 76,
- "FirstName": "Angelina",
- "LastName": "Astaire",
- "LastUpdate": "2013-05-26T14:47:57.62Z",
- "Films": [
- {
- "FilmID": 765,
- "Title": "Saturn Name",
- "Description": "A Fateful Epistle of a Butler And a Boy who must Redeem a Teacher in Berlin",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 7,
- "RentalRate": 4.99,
- "Length": 182,
- "ReplacementCost": 18.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,Commentaries,\"Deleted Scenes\",\"Behind the Scenes\"}",
- "Fulltext": "'berlin':18 'boy':11 'butler':8 'epistl':5 'fate':4 'must':13 'name':2 'redeem':14 'saturn':1 'teacher':16",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 5,
- "Name": "Comedy",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- }
- ]
- },
{
"ActorID": 78,
"FirstName": "Groucho",
@@ -2578,33 +2028,6 @@
}
]
},
- {
- "FilmID": 406,
- "Title": "Haunting Pianist",
- "Description": "A Fast-Paced Story of a Database Administrator And a Composer who must Defeat a Squirrel in An Abandoned Amusement Park",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 5,
- "RentalRate": 0.99,
- "Length": 181,
- "ReplacementCost": 22.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{\"Behind the Scenes\"}",
- "Fulltext": "'abandon':22 'administr':11 'amus':23 'compos':14 'databas':10 'defeat':17 'fast':5 'fast-pac':4 'haunt':1 'must':16 'pace':6 'park':24 'pianist':2 'squirrel':19 'stori':7",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 10,
- "Name": "Games",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- },
{
"FilmID": 473,
"Title": "Jacket Frisco",
@@ -2634,68 +2057,6 @@
}
]
},
- {
- "ActorID": 90,
- "FirstName": "Sean",
- "LastName": "Guiness",
- "LastUpdate": "2013-05-26T14:47:57.62Z",
- "Films": [
- {
- "FilmID": 406,
- "Title": "Haunting Pianist",
- "Description": "A Fast-Paced Story of a Database Administrator And a Composer who must Defeat a Squirrel in An Abandoned Amusement Park",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 5,
- "RentalRate": 0.99,
- "Length": 181,
- "ReplacementCost": 22.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{\"Behind the Scenes\"}",
- "Fulltext": "'abandon':22 'administr':11 'amus':23 'compos':14 'databas':10 'defeat':17 'fast':5 'fast-pac':4 'haunt':1 'must':16 'pace':6 'park':24 'pianist':2 'squirrel':19 'stori':7",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 10,
- "Name": "Games",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- },
- {
- "FilmID": 817,
- "Title": "Soldiers Evolution",
- "Description": "A Lacklusture Panorama of a A Shark And a Pioneer who must Confront a Student in The First Manned Space Station",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 7,
- "RentalRate": 4.99,
- "Length": 185,
- "ReplacementCost": 27.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,Commentaries,\"Deleted Scenes\",\"Behind the Scenes\"}",
- "Fulltext": "'confront':15 'evolut':2 'first':20 'lacklustur':4 'man':21 'must':14 'panorama':5 'pioneer':12 'shark':9 'soldier':1 'space':22 'station':23 'student':17",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 14,
- "Name": "Sci-Fi",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- }
- ]
- },
{
"ActorID": 93,
"FirstName": "Ellen",
@@ -2798,33 +2159,6 @@
"LastUpdate": "2006-02-15T09:46:27Z"
}
]
- },
- {
- "FilmID": 813,
- "Title": "Smoochy Control",
- "Description": "A Thrilling Documentary of a Husband And a Feminist who must Face a Mad Scientist in Ancient China",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 7,
- "RentalRate": 0.99,
- "Length": 184,
- "ReplacementCost": 18.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{\"Behind the Scenes\"}",
- "Fulltext": "'ancient':19 'china':20 'control':2 'documentari':5 'face':14 'feminist':11 'husband':8 'mad':16 'must':13 'scientist':17 'smoochi':1 'thrill':4",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 15,
- "Name": "Sports",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
}
]
},
@@ -2860,68 +2194,6 @@
"LastUpdate": "2006-02-15T09:46:27Z"
}
]
- },
- {
- "FilmID": 765,
- "Title": "Saturn Name",
- "Description": "A Fateful Epistle of a Butler And a Boy who must Redeem a Teacher in Berlin",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 7,
- "RentalRate": 4.99,
- "Length": 182,
- "ReplacementCost": 18.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,Commentaries,\"Deleted Scenes\",\"Behind the Scenes\"}",
- "Fulltext": "'berlin':18 'boy':11 'butler':8 'epistl':5 'fate':4 'must':13 'name':2 'redeem':14 'saturn':1 'teacher':16",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 5,
- "Name": "Comedy",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- }
- ]
- },
- {
- "ActorID": 100,
- "FirstName": "Spencer",
- "LastName": "Depp",
- "LastUpdate": "2013-05-26T14:47:57.62Z",
- "Films": [
- {
- "FilmID": 872,
- "Title": "Sweet Brotherhood",
- "Description": "A Unbelieveable Epistle of a Sumo Wrestler And a Hunter who must Chase a Forensic Psychologist in A Baloon",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 3,
- "RentalRate": 2.99,
- "Length": 185,
- "ReplacementCost": 27.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{\"Deleted Scenes\"}",
- "Fulltext": "'baloon':21 'brotherhood':2 'chase':15 'epistl':5 'forens':17 'hunter':12 'must':14 'psychologist':18 'sumo':8 'sweet':1 'unbeliev':4 'wrestler':9",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 16,
- "Name": "Travel",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
}
]
},
@@ -3251,41 +2523,6 @@
}
]
},
- {
- "ActorID": 112,
- "FirstName": "Russell",
- "LastName": "Bacall",
- "LastUpdate": "2013-05-26T14:47:57.62Z",
- "Films": [
- {
- "FilmID": 817,
- "Title": "Soldiers Evolution",
- "Description": "A Lacklusture Panorama of a A Shark And a Pioneer who must Confront a Student in The First Manned Space Station",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 7,
- "RentalRate": 4.99,
- "Length": 185,
- "ReplacementCost": 27.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,Commentaries,\"Deleted Scenes\",\"Behind the Scenes\"}",
- "Fulltext": "'confront':15 'evolut':2 'first':20 'lacklustur':4 'man':21 'must':14 'panorama':5 'pioneer':12 'shark':9 'soldier':1 'space':22 'station':23 'student':17",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 14,
- "Name": "Sci-Fi",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- }
- ]
- },
{
"ActorID": 113,
"FirstName": "Morgan",
@@ -3978,33 +3215,6 @@
"LastUpdate": "2006-02-15T09:46:27Z"
}
]
- },
- {
- "FilmID": 872,
- "Title": "Sweet Brotherhood",
- "Description": "A Unbelieveable Epistle of a Sumo Wrestler And a Hunter who must Chase a Forensic Psychologist in A Baloon",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 3,
- "RentalRate": 2.99,
- "Length": 185,
- "ReplacementCost": 27.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{\"Deleted Scenes\"}",
- "Fulltext": "'baloon':21 'brotherhood':2 'chase':15 'epistl':5 'forens':17 'hunter':12 'must':14 'psychologist':18 'sumo':8 'sweet':1 'unbeliev':4 'wrestler':9",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 16,
- "Name": "Travel",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
}
]
},
@@ -4145,33 +3355,6 @@
"LastUpdate": "2006-02-15T09:46:27Z"
}
]
- },
- {
- "FilmID": 817,
- "Title": "Soldiers Evolution",
- "Description": "A Lacklusture Panorama of a A Shark And a Pioneer who must Confront a Student in The First Manned Space Station",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 7,
- "RentalRate": 4.99,
- "Length": 185,
- "ReplacementCost": 27.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,Commentaries,\"Deleted Scenes\",\"Behind the Scenes\"}",
- "Fulltext": "'confront':15 'evolut':2 'first':20 'lacklustur':4 'man':21 'must':14 'panorama':5 'pioneer':12 'shark':9 'soldier':1 'space':22 'station':23 'student':17",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 14,
- "Name": "Sci-Fi",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
}
]
},
@@ -4367,87 +3550,6 @@
"LastName": "Malden",
"LastUpdate": "2013-05-26T14:47:57.62Z",
"Films": [
- {
- "FilmID": 24,
- "Title": "Analyze Hoosiers",
- "Description": "A Thoughtful Display of a Explorer And a Pastry Chef who must Overcome a Feminist in The Sahara Desert",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 6,
- "RentalRate": 2.99,
- "Length": 181,
- "ReplacementCost": 19.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,\"Behind the Scenes\"}",
- "Fulltext": "'analyz':1 'chef':12 'desert':21 'display':5 'explor':8 'feminist':17 'hoosier':2 'must':14 'overcom':15 'pastri':11 'sahara':20 'thought':4",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 11,
- "Name": "Horror",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- },
- {
- "FilmID": 406,
- "Title": "Haunting Pianist",
- "Description": "A Fast-Paced Story of a Database Administrator And a Composer who must Defeat a Squirrel in An Abandoned Amusement Park",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 5,
- "RentalRate": 0.99,
- "Length": 181,
- "ReplacementCost": 22.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{\"Behind the Scenes\"}",
- "Fulltext": "'abandon':22 'administr':11 'amus':23 'compos':14 'databas':10 'defeat':17 'fast':5 'fast-pac':4 'haunt':1 'must':16 'pace':6 'park':24 'pianist':2 'squirrel':19 'stori':7",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 10,
- "Name": "Games",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- },
- {
- "FilmID": 535,
- "Title": "Love Suicides",
- "Description": "A Brilliant Panorama of a Hunter And a Explorer who must Pursue a Dentist in An Abandoned Fun House",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 6,
- "RentalRate": 0.99,
- "Length": 181,
- "ReplacementCost": 21.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,\"Behind the Scenes\"}",
- "Fulltext": "'abandon':19 'brilliant':4 'dentist':16 'explor':11 'fun':20 'hous':21 'hunter':8 'love':1 'must':13 'panorama':5 'pursu':14 'suicid':2",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 11,
- "Name": "Horror",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- },
{
"FilmID": 973,
"Title": "Wife Turn",
@@ -4741,41 +3843,6 @@
}
]
},
- {
- "ActorID": 166,
- "FirstName": "Nick",
- "LastName": "Degeneres",
- "LastUpdate": "2013-05-26T14:47:57.62Z",
- "Films": [
- {
- "FilmID": 426,
- "Title": "Home Pity",
- "Description": "A Touching Panorama of a Man And a Secret Agent who must Challenge a Teacher in A MySQL Convention",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 7,
- "RentalRate": 4.99,
- "Length": 185,
- "ReplacementCost": 15.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,Commentaries,\"Behind the Scenes\"}",
- "Fulltext": "'agent':12 'challeng':15 'convent':21 'home':1 'man':8 'must':14 'mysql':20 'panorama':5 'piti':2 'secret':11 'teacher':17 'touch':4",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 12,
- "Name": "Music",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- }
- ]
- },
{
"ActorID": 168,
"FirstName": "Will",
@@ -4962,41 +4029,6 @@
}
]
},
- {
- "ActorID": 171,
- "FirstName": "Olympia",
- "LastName": "Pfeiffer",
- "LastUpdate": "2013-05-26T14:47:57.62Z",
- "Films": [
- {
- "FilmID": 872,
- "Title": "Sweet Brotherhood",
- "Description": "A Unbelieveable Epistle of a Sumo Wrestler And a Hunter who must Chase a Forensic Psychologist in A Baloon",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 3,
- "RentalRate": 2.99,
- "Length": 185,
- "ReplacementCost": 27.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{\"Deleted Scenes\"}",
- "Fulltext": "'baloon':21 'brotherhood':2 'chase':15 'epistl':5 'forens':17 'hunter':12 'must':14 'psychologist':18 'sumo':8 'sweet':1 'unbeliev':4 'wrestler':9",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 16,
- "Name": "Travel",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- }
- ]
- },
{
"ActorID": 172,
"FirstName": "Groucho",
@@ -5094,41 +4126,6 @@
}
]
},
- {
- "ActorID": 176,
- "FirstName": "Jon",
- "LastName": "Chase",
- "LastUpdate": "2013-05-26T14:47:57.62Z",
- "Films": [
- {
- "FilmID": 872,
- "Title": "Sweet Brotherhood",
- "Description": "A Unbelieveable Epistle of a Sumo Wrestler And a Hunter who must Chase a Forensic Psychologist in A Baloon",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 3,
- "RentalRate": 2.99,
- "Length": 185,
- "ReplacementCost": 27.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{\"Deleted Scenes\"}",
- "Fulltext": "'baloon':21 'brotherhood':2 'chase':15 'epistl':5 'forens':17 'hunter':12 'must':14 'psychologist':18 'sumo':8 'sweet':1 'unbeliev':4 'wrestler':9",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 16,
- "Name": "Travel",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- }
- ]
- },
{
"ActorID": 177,
"FirstName": "Gene",
@@ -5164,103 +4161,6 @@
}
]
},
- {
- "ActorID": 178,
- "FirstName": "Lisa",
- "LastName": "Monroe",
- "LastUpdate": "2013-05-26T14:47:57.62Z",
- "Films": [
- {
- "FilmID": 974,
- "Title": "Wild Apollo",
- "Description": "A Beautiful Story of a Monkey And a Sumo Wrestler who must Conquer a A Shark in A MySQL Convention",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 4,
- "RentalRate": 0.99,
- "Length": 181,
- "ReplacementCost": 24.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,Commentaries,\"Deleted Scenes\",\"Behind the Scenes\"}",
- "Fulltext": "'apollo':2 'beauti':4 'conquer':15 'convent':22 'monkey':8 'must':14 'mysql':21 'shark':18 'stori':5 'sumo':11 'wild':1 'wrestler':12",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 13,
- "Name": "New",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- }
- ]
- },
- {
- "ActorID": 179,
- "FirstName": "Ed",
- "LastName": "Guiness",
- "LastUpdate": "2013-05-26T14:47:57.62Z",
- "Films": [
- {
- "FilmID": 24,
- "Title": "Analyze Hoosiers",
- "Description": "A Thoughtful Display of a Explorer And a Pastry Chef who must Overcome a Feminist in The Sahara Desert",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 6,
- "RentalRate": 2.99,
- "Length": 181,
- "ReplacementCost": 19.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,\"Behind the Scenes\"}",
- "Fulltext": "'analyz':1 'chef':12 'desert':21 'display':5 'explor':8 'feminist':17 'hoosier':2 'must':14 'overcom':15 'pastri':11 'sahara':20 'thought':4",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 11,
- "Name": "Horror",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- },
- {
- "FilmID": 817,
- "Title": "Soldiers Evolution",
- "Description": "A Lacklusture Panorama of a A Shark And a Pioneer who must Confront a Student in The First Manned Space Station",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 7,
- "RentalRate": 4.99,
- "Length": 185,
- "ReplacementCost": 27.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,Commentaries,\"Deleted Scenes\",\"Behind the Scenes\"}",
- "Fulltext": "'confront':15 'evolut':2 'first':20 'lacklustur':4 'man':21 'must':14 'panorama':5 'pioneer':12 'shark':9 'soldier':1 'space':22 'station':23 'student':17",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 14,
- "Name": "Sci-Fi",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- }
- ]
- },
{
"ActorID": 180,
"FirstName": "Jeff",
@@ -5587,76 +4487,6 @@
}
]
},
- {
- "ActorID": 190,
- "FirstName": "Audrey",
- "LastName": "Bailey",
- "LastUpdate": "2013-05-26T14:47:57.62Z",
- "Films": [
- {
- "FilmID": 426,
- "Title": "Home Pity",
- "Description": "A Touching Panorama of a Man And a Secret Agent who must Challenge a Teacher in A MySQL Convention",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 7,
- "RentalRate": 4.99,
- "Length": 185,
- "ReplacementCost": 15.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,Commentaries,\"Behind the Scenes\"}",
- "Fulltext": "'agent':12 'challeng':15 'convent':21 'home':1 'man':8 'must':14 'mysql':20 'panorama':5 'piti':2 'secret':11 'teacher':17 'touch':4",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 12,
- "Name": "Music",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- }
- ]
- },
- {
- "ActorID": 192,
- "FirstName": "John",
- "LastName": "Suvari",
- "LastUpdate": "2013-05-26T14:47:57.62Z",
- "Films": [
- {
- "FilmID": 426,
- "Title": "Home Pity",
- "Description": "A Touching Panorama of a Man And a Secret Agent who must Challenge a Teacher in A MySQL Convention",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 7,
- "RentalRate": 4.99,
- "Length": 185,
- "ReplacementCost": 15.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,Commentaries,\"Behind the Scenes\"}",
- "Fulltext": "'agent':12 'challeng':15 'convent':21 'home':1 'man':8 'must':14 'mysql':20 'panorama':5 'piti':2 'secret':11 'teacher':17 'touch':4",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 12,
- "Name": "Music",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- }
- ]
- },
{
"ActorID": 193,
"FirstName": "Burt",
@@ -5724,33 +4554,6 @@
"LastUpdate": "2006-02-15T09:46:27Z"
}
]
- },
- {
- "FilmID": 872,
- "Title": "Sweet Brotherhood",
- "Description": "A Unbelieveable Epistle of a Sumo Wrestler And a Hunter who must Chase a Forensic Psychologist in A Baloon",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 3,
- "RentalRate": 2.99,
- "Length": 185,
- "ReplacementCost": 27.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{\"Deleted Scenes\"}",
- "Fulltext": "'baloon':21 'brotherhood':2 'chase':15 'epistl':5 'forens':17 'hunter':12 'must':14 'psychologist':18 'sumo':8 'sweet':1 'unbeliev':4 'wrestler':9",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 16,
- "Name": "Travel",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
}
]
},
@@ -5786,33 +4589,6 @@
"LastUpdate": "2006-02-15T09:46:27Z"
}
]
- },
- {
- "FilmID": 813,
- "Title": "Smoochy Control",
- "Description": "A Thrilling Documentary of a Husband And a Feminist who must Face a Mad Scientist in Ancient China",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 7,
- "RentalRate": 0.99,
- "Length": 184,
- "ReplacementCost": 18.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{\"Behind the Scenes\"}",
- "Fulltext": "'ancient':19 'china':20 'control':2 'documentari':5 'face':14 'feminist':11 'husband':8 'mad':16 'must':13 'scientist':17 'smoochi':1 'thrill':4",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 15,
- "Name": "Sports",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
}
]
},
@@ -5851,74 +4627,12 @@
}
]
},
- {
- "ActorID": 197,
- "FirstName": "Reese",
- "LastName": "West",
- "LastUpdate": "2013-05-26T14:47:57.62Z",
- "Films": [
- {
- "FilmID": 974,
- "Title": "Wild Apollo",
- "Description": "A Beautiful Story of a Monkey And a Sumo Wrestler who must Conquer a A Shark in A MySQL Convention",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 4,
- "RentalRate": 0.99,
- "Length": 181,
- "ReplacementCost": 24.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,Commentaries,\"Deleted Scenes\",\"Behind the Scenes\"}",
- "Fulltext": "'apollo':2 'beauti':4 'conquer':15 'convent':22 'monkey':8 'must':14 'mysql':21 'shark':18 'stori':5 'sumo':11 'wild':1 'wrestler':12",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 13,
- "Name": "New",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- }
- ]
- },
{
"ActorID": 198,
"FirstName": "Mary",
"LastName": "Keitel",
"LastUpdate": "2013-05-26T14:47:57.62Z",
"Films": [
- {
- "FilmID": 406,
- "Title": "Haunting Pianist",
- "Description": "A Fast-Paced Story of a Database Administrator And a Composer who must Defeat a Squirrel in An Abandoned Amusement Park",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 5,
- "RentalRate": 0.99,
- "Length": 181,
- "ReplacementCost": 22.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{\"Behind the Scenes\"}",
- "Fulltext": "'abandon':22 'administr':11 'amus':23 'compos':14 'databas':10 'defeat':17 'fast':5 'fast-pac':4 'haunt':1 'must':16 'pace':6 'park':24 'pianist':2 'squirrel':19 'stori':7",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 10,
- "Name": "Games",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- },
{
"FilmID": 499,
"Title": "King Evolution",
@@ -5973,33 +4687,6 @@
}
]
},
- {
- "FilmID": 817,
- "Title": "Soldiers Evolution",
- "Description": "A Lacklusture Panorama of a A Shark And a Pioneer who must Confront a Student in The First Manned Space Station",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 7,
- "RentalRate": 4.99,
- "Length": 185,
- "ReplacementCost": 27.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,Commentaries,\"Deleted Scenes\",\"Behind the Scenes\"}",
- "Fulltext": "'confront':15 'evolut':2 'first':20 'lacklustur':4 'man':21 'must':14 'panorama':5 'pioneer':12 'shark':9 'soldier':1 'space':22 'station':23 'student':17",
- "Language": {
- "LanguageID": 1,
- "Name": "English ",
- "LastUpdate": "0001-01-01T00:00:00Z"
- },
- "Categories": [
- {
- "CategoryID": 14,
- "Name": "Sci-Fi",
- "LastUpdate": "2006-02-15T09:46:27Z"
- }
- ]
- },
{
"FilmID": 886,
"Title": "Theory Mermaid",
diff --git a/examples/quick-start/dest2.json b/examples/quick-start/dest2.json
index 095bd0c..9cd444f 100644
--- a/examples/quick-start/dest2.json
+++ b/examples/quick-start/dest2.json
@@ -205,21 +205,6 @@
"SpecialFeatures": "{Trailers,\"Behind the Scenes\"}",
"Fulltext": "'georgia':20 'lacklustur':4 'monkey':17 'must':14 'pocus':2 'red':1 'redeem':15 'soviet':19 'squirrel':12 'sumo':8 'wrestler':9 'yarn':5"
},
- {
- "FilmID": 426,
- "Title": "Home Pity",
- "Description": "A Touching Panorama of a Man And a Secret Agent who must Challenge a Teacher in A MySQL Convention",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 7,
- "RentalRate": 4.99,
- "Length": 185,
- "ReplacementCost": 15.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,Commentaries,\"Behind the Scenes\"}",
- "Fulltext": "'agent':12 'challeng':15 'convent':21 'home':1 'man':8 'must':14 'mysql':20 'panorama':5 'piti':2 'secret':11 'teacher':17 'touch':4"
- },
{
"FilmID": 767,
"Title": "Scalawag Duck",
@@ -243,18 +228,6 @@
"LastName": "Davis",
"LastUpdate": "2013-05-26T14:47:57.62Z"
},
- {
- "ActorID": 21,
- "FirstName": "Kirsten",
- "LastName": "Paltrow",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 36,
- "FirstName": "Burt",
- "LastName": "Dukakis",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
{
"ActorID": 41,
"FirstName": "Jodie",
@@ -273,12 +246,6 @@
"LastName": "Cruise",
"LastUpdate": "2013-05-26T14:47:57.62Z"
},
- {
- "ActorID": 58,
- "FirstName": "Christian",
- "LastName": "Akroyd",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
{
"ActorID": 61,
"FirstName": "Christian",
@@ -314,24 +281,6 @@
"FirstName": "Chris",
"LastName": "Depp",
"LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 166,
- "FirstName": "Nick",
- "LastName": "Degeneres",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 190,
- "FirstName": "Audrey",
- "LastName": "Bailey",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 192,
- "FirstName": "John",
- "LastName": "Suvari",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
}
]
},
@@ -355,21 +304,6 @@
"SpecialFeatures": "{Commentaries,\"Deleted Scenes\"}",
"Fulltext": "'abandon':19 'battl':14 'cabin':2 'emot':4 'frontier':1 'fun':20 'hous':21 'madman':8 'must':13 'stori':5 'teacher':16 'waitress':11"
},
- {
- "FilmID": 974,
- "Title": "Wild Apollo",
- "Description": "A Beautiful Story of a Monkey And a Sumo Wrestler who must Conquer a A Shark in A MySQL Convention",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 4,
- "RentalRate": 0.99,
- "Length": 181,
- "ReplacementCost": 24.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,Commentaries,\"Deleted Scenes\",\"Behind the Scenes\"}",
- "Fulltext": "'apollo':2 'beauti':4 'conquer':15 'convent':22 'monkey':8 'must':14 'mysql':21 'shark':18 'stori':5 'sumo':11 'wild':1 'wrestler':12"
- },
{
"FilmID": 751,
"Title": "Runaway Tenenbaums",
@@ -393,12 +327,6 @@
"LastName": "Lollobrigida",
"LastUpdate": "2013-05-26T14:47:57.62Z"
},
- {
- "ActorID": 9,
- "FirstName": "Joe",
- "LastName": "Swank",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
{
"ActorID": 26,
"FirstName": "Rip",
@@ -411,12 +339,6 @@
"LastName": "Stallone",
"LastUpdate": "2013-05-26T14:47:57.62Z"
},
- {
- "ActorID": 51,
- "FirstName": "Gary",
- "LastName": "Phoenix",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
{
"ActorID": 55,
"FirstName": "Fay",
@@ -452,177 +374,6 @@
"FirstName": "Gene",
"LastName": "Mckellen",
"LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 178,
- "FirstName": "Lisa",
- "LastName": "Monroe",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 197,
- "FirstName": "Reese",
- "LastName": "West",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- }
- ]
- },
- {
- "CategoryID": 11,
- "Name": "Horror",
- "LastUpdate": "2006-02-15T09:46:27Z",
- "Films": [
- {
- "FilmID": 535,
- "Title": "Love Suicides",
- "Description": "A Brilliant Panorama of a Hunter And a Explorer who must Pursue a Dentist in An Abandoned Fun House",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 6,
- "RentalRate": 0.99,
- "Length": 181,
- "ReplacementCost": 21.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,\"Behind the Scenes\"}",
- "Fulltext": "'abandon':19 'brilliant':4 'dentist':16 'explor':11 'fun':20 'hous':21 'hunter':8 'love':1 'must':13 'panorama':5 'pursu':14 'suicid':2"
- },
- {
- "FilmID": 24,
- "Title": "Analyze Hoosiers",
- "Description": "A Thoughtful Display of a Explorer And a Pastry Chef who must Overcome a Feminist in The Sahara Desert",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 6,
- "RentalRate": 2.99,
- "Length": 181,
- "ReplacementCost": 19.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,\"Behind the Scenes\"}",
- "Fulltext": "'analyz':1 'chef':12 'desert':21 'display':5 'explor':8 'feminist':17 'hoosier':2 'must':14 'overcom':15 'pastri':11 'sahara':20 'thought':4"
- }
- ],
- "Actors": [
- {
- "ActorID": 5,
- "FirstName": "Johnny",
- "LastName": "Lollobrigida",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 38,
- "FirstName": "Tom",
- "LastName": "Mckellen",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 42,
- "FirstName": "Tom",
- "LastName": "Miranda",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 61,
- "FirstName": "Christian",
- "LastName": "Neeson",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 67,
- "FirstName": "Jessica",
- "LastName": "Bailey",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 157,
- "FirstName": "Greta",
- "LastName": "Malden",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 179,
- "FirstName": "Ed",
- "LastName": "Guiness",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- }
- ]
- },
- {
- "CategoryID": 14,
- "Name": "Sci-Fi",
- "LastUpdate": "2006-02-15T09:46:27Z",
- "Films": [
- {
- "FilmID": 817,
- "Title": "Soldiers Evolution",
- "Description": "A Lacklusture Panorama of a A Shark And a Pioneer who must Confront a Student in The First Manned Space Station",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 7,
- "RentalRate": 4.99,
- "Length": 185,
- "ReplacementCost": 27.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,Commentaries,\"Deleted Scenes\",\"Behind the Scenes\"}",
- "Fulltext": "'confront':15 'evolut':2 'first':20 'lacklustur':4 'man':21 'must':14 'panorama':5 'pioneer':12 'shark':9 'soldier':1 'space':22 'station':23 'student':17"
- }
- ],
- "Actors": [
- {
- "ActorID": 5,
- "FirstName": "Johnny",
- "LastName": "Lollobrigida",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 13,
- "FirstName": "Uma",
- "LastName": "Wood",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 15,
- "FirstName": "Cuba",
- "LastName": "Olivier",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 35,
- "FirstName": "Judy",
- "LastName": "Dean",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 90,
- "FirstName": "Sean",
- "LastName": "Guiness",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 112,
- "FirstName": "Russell",
- "LastName": "Bacall",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 153,
- "FirstName": "Minnie",
- "LastName": "Kilmer",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 179,
- "FirstName": "Ed",
- "LastName": "Guiness",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 198,
- "FirstName": "Mary",
- "LastName": "Keitel",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
}
]
},
@@ -660,21 +411,6 @@
"LastUpdate": "2013-05-26T14:50:58.951Z",
"SpecialFeatures": "{\"Behind the Scenes\"}",
"Fulltext": "'amaz':4 'build':15 'compos':12 'drama':5 'husband':17 'mad':8 'must':14 'outback':20 'record':1 'scientist':9 'zorro':2"
- },
- {
- "FilmID": 813,
- "Title": "Smoochy Control",
- "Description": "A Thrilling Documentary of a Husband And a Feminist who must Face a Mad Scientist in Ancient China",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 7,
- "RentalRate": 0.99,
- "Length": 184,
- "ReplacementCost": 18.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{\"Behind the Scenes\"}",
- "Fulltext": "'ancient':19 'china':20 'control':2 'documentari':5 'face':14 'feminist':11 'husband':8 'mad':16 'must':13 'scientist':17 'smoochi':1 'thrill':4"
}
],
"Actors": [
@@ -696,12 +432,6 @@
"LastName": "Willis",
"LastUpdate": "2013-05-26T14:47:57.62Z"
},
- {
- "ActorID": 95,
- "FirstName": "Daryl",
- "LastName": "Wahlberg",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
{
"ActorID": 101,
"FirstName": "Susan",
@@ -761,12 +491,6 @@
"FirstName": "Meryl",
"LastName": "Allen",
"LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 195,
- "FirstName": "Jayne",
- "LastName": "Silverstone",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
}
]
},
@@ -1027,21 +751,6 @@
"SpecialFeatures": "{Commentaries,\"Behind the Scenes\"}",
"Fulltext": "'astound':4 'boat':21 'car':11 'caus':2 'crocodil':8 'monsoon':1 'must':13 'outrac':14 'squirrel':16 'tale':5 'u':20 'u-boat':19"
},
- {
- "FilmID": 406,
- "Title": "Haunting Pianist",
- "Description": "A Fast-Paced Story of a Database Administrator And a Composer who must Defeat a Squirrel in An Abandoned Amusement Park",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 5,
- "RentalRate": 0.99,
- "Length": 181,
- "ReplacementCost": 22.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{\"Behind the Scenes\"}",
- "Fulltext": "'abandon':22 'administr':11 'amus':23 'compos':14 'databas':10 'defeat':17 'fast':5 'fast-pac':4 'haunt':1 'must':16 'pace':6 'park':24 'pianist':2 'squirrel':19 'stori':7"
- },
{
"FilmID": 141,
"Title": "Chicago North",
@@ -1089,12 +798,6 @@
"LastName": "Hopkins",
"LastUpdate": "2013-05-26T14:47:57.62Z"
},
- {
- "ActorID": 62,
- "FirstName": "Jayne",
- "LastName": "Neeson",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
{
"ActorID": 64,
"FirstName": "Ray",
@@ -1113,18 +816,6 @@
"LastName": "Zellweger",
"LastUpdate": "2013-05-26T14:47:57.62Z"
},
- {
- "ActorID": 89,
- "FirstName": "Charlize",
- "LastName": "Dench",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 90,
- "FirstName": "Sean",
- "LastName": "Guiness",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
{
"ActorID": 118,
"FirstName": "Cuba",
@@ -1167,12 +858,6 @@
"LastName": "Gibson",
"LastUpdate": "2013-05-26T14:47:57.62Z"
},
- {
- "ActorID": 157,
- "FirstName": "Greta",
- "LastName": "Malden",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
{
"ActorID": 175,
"FirstName": "William",
@@ -1225,21 +910,6 @@
"SpecialFeatures": "{Commentaries}",
"Fulltext": "'anthem':2 'battl':14 'cat':16 'control':1 'documentari':5 'fate':4 'monasteri':19 'must':13 'robot':8 'student':11"
},
- {
- "FilmID": 765,
- "Title": "Saturn Name",
- "Description": "A Fateful Epistle of a Butler And a Boy who must Redeem a Teacher in Berlin",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 7,
- "RentalRate": 4.99,
- "Length": 182,
- "ReplacementCost": 18.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{Trailers,Commentaries,\"Deleted Scenes\",\"Behind the Scenes\"}",
- "Fulltext": "'berlin':18 'boy':11 'butler':8 'epistl':5 'fate':4 'must':13 'name':2 'redeem':14 'saturn':1 'teacher':16"
- },
{
"FilmID": 774,
"Title": "Searchers Wait",
@@ -1269,24 +939,12 @@
"LastName": "Olivier",
"LastUpdate": "2013-05-26T14:47:57.62Z"
},
- {
- "ActorID": 76,
- "FirstName": "Angelina",
- "LastName": "Astaire",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
{
"ActorID": 89,
"FirstName": "Charlize",
"LastName": "Dench",
"LastUpdate": "2013-05-26T14:47:57.62Z"
},
- {
- "ActorID": 98,
- "FirstName": "Chris",
- "LastName": "Bridges",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
{
"ActorID": 101,
"FirstName": "Susan",
@@ -1680,21 +1338,6 @@
"LastUpdate": "2013-05-26T14:50:58.951Z",
"SpecialFeatures": "{\"Deleted Scenes\"}",
"Fulltext": "'ancient':19 'bright':2 'husband':12 'india':20 'madman':17 'muscl':1 'must':14 'panorama':5 'redeem':15 'stun':4 'sumo':8 'wrestler':9"
- },
- {
- "FilmID": 872,
- "Title": "Sweet Brotherhood",
- "Description": "A Unbelieveable Epistle of a Sumo Wrestler And a Hunter who must Chase a Forensic Psychologist in A Baloon",
- "ReleaseYear": 2006,
- "LanguageID": 1,
- "RentalDuration": 3,
- "RentalRate": 2.99,
- "Length": 185,
- "ReplacementCost": 27.99,
- "Rating": "R",
- "LastUpdate": "2013-05-26T14:50:58.951Z",
- "SpecialFeatures": "{\"Deleted Scenes\"}",
- "Fulltext": "'baloon':21 'brotherhood':2 'chase':15 'epistl':5 'forens':17 'hunter':12 'must':14 'psychologist':18 'sumo':8 'sweet':1 'unbeliev':4 'wrestler':9"
}
],
"Actors": [
@@ -1704,48 +1347,18 @@
"LastName": "Williams",
"LastUpdate": "2013-05-26T14:47:57.62Z"
},
- {
- "ActorID": 74,
- "FirstName": "Milla",
- "LastName": "Keitel",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 100,
- "FirstName": "Spencer",
- "LastName": "Depp",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
{
"ActorID": 103,
"FirstName": "Matthew",
"LastName": "Leigh",
"LastUpdate": "2013-05-26T14:47:57.62Z"
},
- {
- "ActorID": 143,
- "FirstName": "River",
- "LastName": "Dean",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 171,
- "FirstName": "Olympia",
- "LastName": "Pfeiffer",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
{
"ActorID": 172,
"FirstName": "Groucho",
"LastName": "Williams",
"LastUpdate": "2013-05-26T14:47:57.62Z"
},
- {
- "ActorID": 176,
- "FirstName": "Jon",
- "LastName": "Chase",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
- },
{
"ActorID": 180,
"FirstName": "Jeff",
@@ -1757,12 +1370,6 @@
"FirstName": "Matthew",
"LastName": "Carrey",
"LastUpdate": "2013-05-26T14:47:57.62Z"
- },
- {
- "ActorID": 194,
- "FirstName": "Meryl",
- "LastName": "Allen",
- "LastUpdate": "2013-05-26T14:47:57.62Z"
}
]
}
diff --git a/examples/quick-start/quick-start.go b/examples/quick-start/quick-start.go
index f420169..a0fb252 100644
--- a/examples/quick-start/quick-start.go
+++ b/examples/quick-start/quick-start.go
@@ -13,6 +13,7 @@ import (
. "github.com/go-jet/jet/v2/examples/quick-start/.gen/jetdb/dvds/table"
. "github.com/go-jet/jet/v2/postgres"
+ "github.com/go-jet/jet/v2/examples/quick-start/.gen/jetdb/dvds/enum"
"github.com/go-jet/jet/v2/examples/quick-start/.gen/jetdb/dvds/model"
)
@@ -48,7 +49,8 @@ func main() {
).WHERE(
Language.Name.EQ(Char(20)("English")).
AND(Category.Name.NOT_EQ(Text("Action"))).
- AND(Film.Length.GT(Int(180))),
+ AND(Film.Length.GT(Int(180))).
+ AND(Film.Rating.NOT_EQ(enum.MpaaRating.R)),
).ORDER_BY(
Actor.ActorID.ASC(),
Film.FilmID.ASC(),
diff --git a/tests/postgres/select_test.go b/tests/postgres/select_test.go
index dc7ca48..6997223 100644
--- a/tests/postgres/select_test.go
+++ b/tests/postgres/select_test.go
@@ -2739,7 +2739,7 @@ FROM dvds.actor
INNER JOIN dvds.language ON (language.language_id = film.language_id)
INNER JOIN dvds.film_category ON (film_category.film_id = film.film_id)
INNER JOIN dvds.category ON (category.category_id = film_category.category_id)
-WHERE ((language.name = 'English'::char(20)) AND (category.name != 'Action'::text)) AND (film.length > 180::integer)
+WHERE (((language.name = 'English'::char(20)) AND (category.name != 'Action'::text)) AND (film.length > 180::integer)) AND (film.rating != 'R')
ORDER BY actor.actor_id ASC, film.film_id ASC;
`
@@ -2758,7 +2758,8 @@ ORDER BY actor.actor_id ASC, film.film_id ASC;
).WHERE(
Language.Name.EQ(Char(20)("English")). // note that every column has type.
AND(Category.Name.NOT_EQ(Text("Action"))). // String column Language.Name and Category.Name can be compared only with string expression
- AND(Film.Length.GT(Int32(180))), // Film.Length is integer column and can be compared only with integer expression
+ AND(Film.Length.GT(Int32(180))). // Film.Length is integer column and can be compared only with integer expression
+ AND(Film.Rating.NOT_EQ(enum.MpaaRating.R)),
).ORDER_BY(
Actor.ActorID.ASC(),
Film.FilmID.ASC(),
@@ -2805,7 +2806,7 @@ func TestSelectQuickStartWithSubQueries(t *testing.T) {
filmLogerThan180 := Film.
SELECT(Film.AllColumns).
- WHERE(Film.Length.GT(Int(180))).
+ WHERE(Film.Length.GT(Int(180)).AND(Film.Rating.NOT_EQ(enum.MpaaRating.R))).
AsTable("films")
filmID := Film.FilmID.From(filmLogerThan180)
diff --git a/tests/testdata b/tests/testdata
index b0ff9d7..89dc2c6 160000
--- a/tests/testdata
+++ b/tests/testdata
@@ -1 +1 @@
-Subproject commit b0ff9d75f2b829a83706b485fba4aaf8563860e2
+Subproject commit 89dc2c61a2419a281eeed5d95174eab0ca192fb4
From 959811b1209d0e3fa5862dac22600d180568b3e5 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 21 Mar 2025 21:06:32 +0000
Subject: [PATCH 2/4] Bump github.com/bytedance/sonic from 1.13.1 to 1.13.2
Bumps [github.com/bytedance/sonic](https://github.com/bytedance/sonic) from 1.13.1 to 1.13.2.
- [Release notes](https://github.com/bytedance/sonic/releases)
- [Commits](https://github.com/bytedance/sonic/compare/v1.13.1...v1.13.2)
---
updated-dependencies:
- dependency-name: github.com/bytedance/sonic
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index 9ef9dd7..18ffeb4 100644
--- a/go.mod
+++ b/go.mod
@@ -15,7 +15,7 @@ require (
// used in tests
require (
- github.com/bytedance/sonic v1.13.1
+ github.com/bytedance/sonic v1.13.2
github.com/google/go-cmp v0.7.0
github.com/pkg/profile v1.7.0
github.com/shopspring/decimal v1.4.0
diff --git a/go.sum b/go.sum
index 104224e..e43b263 100644
--- a/go.sum
+++ b/go.sum
@@ -3,8 +3,8 @@ filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
-github.com/bytedance/sonic v1.13.1 h1:Jyd5CIvdFnkOWuKXr+wm4Nyk2h0yAFsr8ucJgEasO3g=
-github.com/bytedance/sonic v1.13.1/go.mod h1:o68xyaF9u2gvVBuGHPlUVCy+ZfmNNO5ETf1+KgkJhz4=
+github.com/bytedance/sonic v1.13.2 h1:8/H1FempDZqC4VqjptGo14QQlJx8VdZJegxs6wwfqpQ=
+github.com/bytedance/sonic v1.13.2/go.mod h1:o68xyaF9u2gvVBuGHPlUVCy+ZfmNNO5ETf1+KgkJhz4=
github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=
github.com/bytedance/sonic/loader v0.2.4 h1:ZWCw4stuXUsn1/+zQDqeE7JKP+QO47tz7QCNan80NzY=
github.com/bytedance/sonic/loader v0.2.4/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=
From acd1aa2078dbcbfc66e422435ce849cc73fbb080 Mon Sep 17 00:00:00 2001
From: go-jet
Date: Mon, 31 Mar 2025 20:04:31 +0200
Subject: [PATCH 3/4] Uncomment TestNorthwindJoinEverythingJsonSonic since
sonic library bug is fixed now.
---
tests/postgres/northwind_test.go | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/tests/postgres/northwind_test.go b/tests/postgres/northwind_test.go
index 7270202..aeda946 100644
--- a/tests/postgres/northwind_test.go
+++ b/tests/postgres/northwind_test.go
@@ -119,12 +119,11 @@ func BenchmarkTestNorthwindJoinEverythingSonicJson(b *testing.B) {
})
}
-// uncomment when bug is fixed: https://github.com/bytedance/sonic/issues/774
-//func TestNorthwindJoinEverythingJsonSonic(t *testing.T) {
-// useJsonUnmarshalFunc(sonic.Unmarshal, func() {
-// testNorthwindJoinEverythingJson(t)
-// })
-//}
+func TestNorthwindJoinEverythingJsonSonic(t *testing.T) {
+ useJsonUnmarshalFunc(sonic.Unmarshal, func() {
+ testNorthwindJoinEverythingJson(t)
+ })
+}
func testNorthwindJoinEverythingJson(t require.TestingT) {
From 0947de0628a45e3f62a3f2a3ae13bf815a5f8e49 Mon Sep 17 00:00:00 2001
From: markvai
Date: Thu, 27 Mar 2025 17:42:27 +0200
Subject: [PATCH 4/4] Add the ability to use custom generic types with non std
inner types
- fix #442
- Since handling all edge cases for generic type parsing is not trivial, users will specify the fields manually.
- To support more than one import per type, add an additional field for extra imports per type.
- Add examples for defining those types in the current tests that show how to define custom types.
---
generator/template/model_template.go | 13 ++++----
tests/mysql/generator_template_test.go | 40 ++++++++++++++---------
tests/postgres/generator_template_test.go | 15 ++++++---
3 files changed, 42 insertions(+), 26 deletions(-)
diff --git a/generator/template/model_template.go b/generator/template/model_template.go
index 84f46d7..2b4ec8a 100644
--- a/generator/template/model_template.go
+++ b/generator/template/model_template.go
@@ -106,10 +106,10 @@ func getTableModelImports(modelType TableModel, tableMetaData metadata.Table) []
importPaths := map[string]bool{}
for _, columnMetaData := range tableMetaData.Columns {
field := modelType.Field(columnMetaData)
- importPath := field.Type.ImportPath
-
- if importPath != "" {
- importPaths[importPath] = true
+ for _, importPath := range append([]string{field.Type.ImportPath}, field.Type.AdditionalImportPaths...) {
+ if importPath != "" {
+ importPaths[importPath] = true
+ }
}
}
@@ -207,8 +207,9 @@ func (f TableModelField) TagsString() string {
// Type represents type of the struct field
type Type struct {
- ImportPath string
- Name string
+ ImportPath string
+ AdditionalImportPaths []string
+ Name string
}
// NewType creates new type for dummy object
diff --git a/tests/mysql/generator_template_test.go b/tests/mysql/generator_template_test.go
index 8c539e2..18055c1 100644
--- a/tests/mysql/generator_template_test.go
+++ b/tests/mysql/generator_template_test.go
@@ -8,7 +8,7 @@ import (
"github.com/go-jet/jet/v2/generator/template"
"github.com/go-jet/jet/v2/internal/3rdparty/snaker"
"github.com/go-jet/jet/v2/internal/utils/dbidentifier"
- postgres2 "github.com/go-jet/jet/v2/postgres"
+ "github.com/go-jet/jet/v2/mysql"
"github.com/go-jet/jet/v2/tests/dbconfig"
file2 "github.com/go-jet/jet/v2/tests/internal/utils/file"
"github.com/stretchr/testify/require"
@@ -49,7 +49,7 @@ func TestGeneratorTemplate_Schema_ChangePath(t *testing.T) {
err := mysql2.Generate(
tempTestDir,
dbConnection("dvds"),
- template.Default(postgres2.Dialect).
+ template.Default(mysql.Dialect).
UseSchema(func(schemaMetaData metadata.Schema) template.Schema {
return template.DefaultSchema(schemaMetaData).UsePath("new/schema/path")
}),
@@ -67,7 +67,7 @@ func TestGeneratorTemplate_Model_SkipGeneration(t *testing.T) {
err := mysql2.Generate(
tempTestDir,
dbConnection("dvds"),
- template.Default(postgres2.Dialect).
+ template.Default(mysql.Dialect).
UseSchema(func(schemaMetaData metadata.Schema) template.Schema {
return template.DefaultSchema(schemaMetaData).
UseModel(template.Model{
@@ -88,7 +88,7 @@ func TestGeneratorTemplate_SQLBuilder_SkipGeneration(t *testing.T) {
err := mysql2.Generate(
tempTestDir,
dbConnection("dvds"),
- template.Default(postgres2.Dialect).
+ template.Default(mysql.Dialect).
UseSchema(func(schemaMetaData metadata.Schema) template.Schema {
return template.DefaultSchema(schemaMetaData).
UseSQLBuilder(template.SQLBuilder{
@@ -111,7 +111,7 @@ func TestGeneratorTemplate_Model_ChangePath(t *testing.T) {
err := mysql2.Generate(
tempTestDir,
dbConnection("dvds"),
- template.Default(postgres2.Dialect).
+ template.Default(mysql.Dialect).
UseSchema(func(schemaMetaData metadata.Schema) template.Schema {
return template.DefaultSchema(schemaMetaData).
UseModel(template.DefaultModel().UsePath(newModelPath))
@@ -129,7 +129,7 @@ func TestGeneratorTemplate_SQLBuilder_ChangePath(t *testing.T) {
err := mysql2.Generate(
tempTestDir,
dbConnection("dvds"),
- template.Default(postgres2.Dialect).
+ template.Default(mysql.Dialect).
UseSchema(func(schemaMetaData metadata.Schema) template.Schema {
return template.DefaultSchema(schemaMetaData).
UseSQLBuilder(template.DefaultSQLBuilder().UsePath(newModelPath))
@@ -150,7 +150,7 @@ func TestGeneratorTemplate_Model_RenameFilesAndTypes(t *testing.T) {
err := mysql2.Generate(
tempTestDir,
dbConnection("dvds"),
- template.Default(postgres2.Dialect).
+ template.Default(mysql.Dialect).
UseSchema(func(schemaMetaData metadata.Schema) template.Schema {
return template.DefaultSchema(schemaMetaData).
UseModel(template.DefaultModel().
@@ -188,7 +188,7 @@ func TestGeneratorTemplate_Model_SkipTableAndEnum(t *testing.T) {
err := mysql2.Generate(
tempTestDir,
dbConnection("dvds"),
- template.Default(postgres2.Dialect).
+ template.Default(mysql.Dialect).
UseSchema(func(schemaMetaData metadata.Schema) template.Schema {
return template.DefaultSchema(schemaMetaData).
UseModel(template.DefaultModel().
@@ -216,7 +216,7 @@ func TestGeneratorTemplate_SQLBuilder_SkipTableAndEnum(t *testing.T) {
err := mysql2.Generate(
tempTestDir,
dbConnection("dvds"),
- template.Default(postgres2.Dialect).
+ template.Default(mysql.Dialect).
UseSchema(func(schemaMetaData metadata.Schema) template.Schema {
return template.DefaultSchema(schemaMetaData).
UseSQLBuilder(template.DefaultSQLBuilder().
@@ -249,7 +249,7 @@ func TestGeneratorTemplate_SQLBuilder_ChangeTypeAndFileName(t *testing.T) {
err := mysql2.Generate(
tempTestDir,
dbConnection("dvds"),
- template.Default(postgres2.Dialect).
+ template.Default(mysql.Dialect).
UseSchema(func(schemaMetaData metadata.Schema) template.Schema {
return template.DefaultSchema(schemaMetaData).
UseSQLBuilder(template.DefaultSQLBuilder().
@@ -289,7 +289,7 @@ func TestGeneratorTemplate_SQLBuilder_DefaultAlias(t *testing.T) {
err := mysql2.Generate(
tempTestDir,
dbConnection("dvds"),
- template.Default(postgres2.Dialect).
+ template.Default(mysql.Dialect).
UseSchema(func(schemaMetaData metadata.Schema) template.Schema {
return template.DefaultSchema(schemaMetaData).
UseSQLBuilder(template.DefaultSQLBuilder().
@@ -313,7 +313,7 @@ func TestGeneratorTemplate_Model_AddTags(t *testing.T) {
err := mysql2.Generate(
tempTestDir,
dbConnection("dvds"),
- template.Default(postgres2.Dialect).
+ template.Default(mysql.Dialect).
UseSchema(func(schemaMetaData metadata.Schema) template.Schema {
return template.DefaultSchema(schemaMetaData).
UseModel(template.DefaultModel().
@@ -354,7 +354,7 @@ func TestGeneratorTemplate_Model_ChangeFieldTypes(t *testing.T) {
err := mysql2.Generate(
tempTestDir,
dbConnection("dvds"),
- template.Default(postgres2.Dialect).
+ template.Default(mysql.Dialect).
UseSchema(func(schemaMetaData metadata.Schema) template.Schema {
return template.DefaultSchema(schemaMetaData).
UseModel(template.DefaultModel().
@@ -376,6 +376,12 @@ func TestGeneratorTemplate_Model_ChangeFieldTypes(t *testing.T) {
defaultTableModelField.Type = template.NewType(sql.NullFloat64{})
case "*time.Time":
defaultTableModelField.Type = template.NewType(sql.NullTime{})
+ case "time.Time":
+ defaultTableModelField.Type = template.Type{
+ ImportPath: "database/sql",
+ AdditionalImportPaths: []string{"github.com/google/uuid"},
+ Name: "sql.Null[uuid.UUID]",
+ }
}
return defaultTableModelField
})
@@ -387,17 +393,19 @@ func TestGeneratorTemplate_Model_ChangeFieldTypes(t *testing.T) {
require.Nil(t, err)
data := file2.Exists(t, defaultModelPath, "film.go")
- require.Contains(t, data, "\"database/sql\"")
+ require.Contains(t, data, `database/sql"`)
+ require.Contains(t, data, `"github.com/google/uuid"`)
require.Contains(t, data, "Description sql.NullString")
require.Contains(t, data, "ReleaseYear *int16")
require.Contains(t, data, "SpecialFeatures sql.NullString")
+ require.Contains(t, data, "LastUpdate sql.Null[uuid.UUID]")
}
func TestGeneratorTemplate_SQLBuilder_ChangeColumnTypes(t *testing.T) {
err := mysql2.Generate(
tempTestDir,
dbConnection("dvds"),
- template.Default(postgres2.Dialect).
+ template.Default(mysql.Dialect).
UseSchema(func(schemaMetaData metadata.Schema) template.Schema {
return template.DefaultSchema(schemaMetaData).
UseSQLBuilder(template.DefaultSQLBuilder().
@@ -420,5 +428,5 @@ func TestGeneratorTemplate_SQLBuilder_ChangeColumnTypes(t *testing.T) {
require.Nil(t, err)
actor := file2.Exists(t, defaultActorSQLBuilderFilePath)
- require.Contains(t, actor, "ActorID postgres.ColumnString")
+ require.Contains(t, actor, "ActorID mysql.ColumnString")
}
diff --git a/tests/postgres/generator_template_test.go b/tests/postgres/generator_template_test.go
index e518db7..a63c3d2 100644
--- a/tests/postgres/generator_template_test.go
+++ b/tests/postgres/generator_template_test.go
@@ -3,9 +3,6 @@ package postgres
import (
"database/sql"
"fmt"
- "path/filepath"
- "testing"
-
"github.com/go-jet/jet/v2/generator/metadata"
"github.com/go-jet/jet/v2/generator/postgres"
"github.com/go-jet/jet/v2/generator/template"
@@ -16,6 +13,8 @@ import (
"github.com/go-jet/jet/v2/tests/dbconfig"
file2 "github.com/go-jet/jet/v2/tests/internal/utils/file"
"github.com/stretchr/testify/require"
+ "path/filepath"
+ "testing"
)
const tempTestDir = "./.tempTestDir"
@@ -432,6 +431,12 @@ func TestGeneratorTemplate_Model_ChangeFieldTypes(t *testing.T) {
defaultTableModelField.Type = template.NewType(sql.NullFloat64{})
case "*time.Time":
defaultTableModelField.Type = template.NewType(sql.NullTime{})
+ case "time.Time":
+ defaultTableModelField.Type = template.Type{
+ ImportPath: "database/sql",
+ AdditionalImportPaths: []string{"github.com/google/uuid"},
+ Name: "sql.Null[uuid.UUID]",
+ }
}
return defaultTableModelField
})
@@ -443,10 +448,12 @@ func TestGeneratorTemplate_Model_ChangeFieldTypes(t *testing.T) {
require.Nil(t, err)
data := file2.Exists(t, defaultModelPath, "film.go")
- require.Contains(t, data, "\"database/sql\"")
+ require.Contains(t, data, `"database/sql"`)
+ require.Contains(t, data, `"github.com/google/uuid"`)
require.Contains(t, data, "Description sql.NullString")
require.Contains(t, data, "ReleaseYear sql.NullInt32")
require.Contains(t, data, "SpecialFeatures sql.NullString")
+ require.Contains(t, data, "LastUpdate sql.Null[uuid.UUID]")
}
func TestGeneratorTemplate_SQLBuilder_ChangeColumnTypes(t *testing.T) {