>>>pipeline_explain.txt
=== Customer
ID:          default_catalog.default_database.Customer
Type:        stream
Stage:       flink
Primary key: customerid, lastUpdated
Timestamp:   timestamp
Row count:   ~1e8
---
Schema:
 - customerid: BIGINT NOT NULL
 - email: VARCHAR(2147483647) CHARACTER SET "UTF-16LE" NOT NULL
 - name: VARCHAR(2147483647) CHARACTER SET "UTF-16LE" NOT NULL
 - lastUpdated: BIGINT NOT NULL
 - timestamp: TIMESTAMP_LTZ(3) *ROWTIME* NOT NULL
Inputs:
 - default_catalog.default_database.Customer__base
Annotations:
 - stream-root: Customer
Plan:
LogicalWatermarkAssigner(rowtime=[timestamp], watermark=[-($4, 1:INTERVAL SECOND)])
  LogicalProject(customerid=[$0], email=[$1], name=[$2], lastUpdated=[$3], timestamp=[COALESCE(TO_TIMESTAMP_LTZ($3, 0), 1970-01-01 08:00:00:TIMESTAMP_WITH_LOCAL_TIME_ZONE(3))])
    LogicalTableScan(table=[[default_catalog, default_database, Customer]])
SQL:
CREATE TEMPORARY TABLE `Customer__schema` (
  `customerid` BIGINT NOT NULL,
  `email` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,
  `name` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,
  `lastUpdated` BIGINT NOT NULL
)
WITH (
  'connector' = 'datagen'
);
CREATE TABLE `Customer` (
  `timestamp` AS COALESCE(`TO_TIMESTAMP_LTZ`(`lastUpdated`, 0), CAST(TIMESTAMP '1970-01-01 00:00:00.000' AS TIMESTAMP(3) WITH LOCAL TIME ZONE)),
  PRIMARY KEY (`customerid`, `lastUpdated`) NOT ENFORCED,
  WATERMARK FOR `timestamp` AS `timestamp` - INTERVAL '0.001' SECOND
)
WITH (
  'format' = 'flexible-json',
  'path' = 'file:/mock',
  'source.monitor-interval' = '10 sec',
  'connector' = 'filesystem'
)
LIKE `Customer__schema`
=== Orders
ID:          default_catalog.default_database.Orders
Type:        stream
Stage:       flink
Primary key: id, time
Timestamp:   time
Row count:   ~1e8
---
Schema:
 - id: BIGINT NOT NULL
 - customerid: BIGINT NOT NULL
 - time: TIMESTAMP_LTZ(3) *ROWTIME* NOT NULL
 - entries: RecordType:peek_no_expand(BIGINT NOT NULL productid, BIGINT NOT NULL quantity, DOUBLE NOT NULL unit_price, DOUBLE discount) NOT NULL ARRAY NOT NULL
Inputs:
 - default_catalog.default_database._Orders
Annotations:
 - stream-root: _Orders
Plan:
LogicalProject(id=[$0], customerid=[$1], time=[$2], entries=[$3])
  LogicalTableScan(table=[[default_catalog, default_database, _Orders]])
SQL:
CREATE VIEW `Orders` AS  SELECT * FROM _Orders;

=== OrdersById
ID:          default_catalog.default_database.OrdersById
Type:        query
Stage:       postgres
---
Inputs:
 - default_catalog.default_database.Orders
Annotations:
 - stream-root: _Orders
 - parameters: id
 - base-table: Orders
Plan:
LogicalProject(id=[$0], customerid=[$1], time=[$2], entries=[$3])
  LogicalFilter(condition=[=(?0, $0)])
    LogicalTableScan(table=[[default_catalog, default_database, Orders]])
SQL:
CREATE VIEW `OrdersById` AS  SELECT * FROM Orders WHERE ?   = id;

=== OrdersByTime
ID:          default_catalog.default_database.OrdersByTime
Type:        query
Stage:       postgres
---
Inputs:
 - default_catalog.default_database.Orders
Annotations:
 - stream-root: _Orders
 - parameters: time, customerid
 - base-table: Orders
Plan:
LogicalProject(id=[$0], customerid=[$1], time=[$2], entries=[$3])
  LogicalFilter(condition=[AND(>($2, ?0), =($1, ?1))])
    LogicalTableScan(table=[[default_catalog, default_database, Orders]])
SQL:
CREATE VIEW `OrdersByTime` AS  SELECT * FROM Orders WHERE `time` > ?     AND customerid = ?          ;

=== Product
ID:          default_catalog.default_database.Product
Type:        stream
Stage:       flink
Primary key: productid, name, description, category
Timestamp:   _ingest_time
Row count:   ~1e8
---
Schema:
 - productid: BIGINT NOT NULL
 - name: VARCHAR(2147483647) CHARACTER SET "UTF-16LE" NOT NULL
 - description: VARCHAR(2147483647) CHARACTER SET "UTF-16LE" NOT NULL
 - category: VARCHAR(2147483647) CHARACTER SET "UTF-16LE" NOT NULL
 - _ingest_time: TIMESTAMP_LTZ(3) *ROWTIME* NOT NULL
Inputs:
 - default_catalog.default_database._Product
Annotations:
 - stream-root: _Product
Plan:
LogicalProject(productid=[$0], name=[$1], description=[$2], category=[$3], _ingest_time=[$4])
  LogicalTableScan(table=[[default_catalog, default_database, _Product]])
SQL:
CREATE VIEW `Product` AS  SELECT * FROM _Product;

=== _Orders
ID:          default_catalog.default_database._Orders
Type:        stream
Stage:       flink
Primary key: id, time
Timestamp:   time
Row count:   ~1e8
---
Schema:
 - id: BIGINT NOT NULL
 - customerid: BIGINT NOT NULL
 - time: TIMESTAMP_LTZ(3) *ROWTIME* NOT NULL
 - entries: RecordType:peek_no_expand(BIGINT NOT NULL productid, BIGINT NOT NULL quantity, DOUBLE NOT NULL unit_price, DOUBLE discount) NOT NULL ARRAY NOT NULL
Inputs:
 - default_catalog.default_database._Orders__base
Annotations:
 - features: DENORMALIZE (feature)
 - stream-root: _Orders
Plan:
LogicalWatermarkAssigner(rowtime=[time], watermark=[-($2, 1:INTERVAL SECOND)])
  LogicalTableScan(table=[[default_catalog, default_database, _Orders]])
SQL:
CREATE TEMPORARY TABLE `_Orders__schema` (
  `id` BIGINT NOT NULL,
  `customerid` BIGINT NOT NULL,
  `time` TIMESTAMP(3) WITH LOCAL TIME ZONE NOT NULL,
  `entries` ROW(`productid` BIGINT NOT NULL, `quantity` BIGINT NOT NULL, `unit_price` DOUBLE NOT NULL, `discount` DOUBLE) NOT NULL ARRAY NOT NULL
)
WITH (
  'connector' = 'datagen'
);
CREATE TABLE `_Orders` (
  PRIMARY KEY (`id`, `time`) NOT ENFORCED,
  WATERMARK FOR `time` AS `time` - INTERVAL '0.001' SECOND
)
WITH (
  'format' = 'flexible-json',
  'path' = 'file:/mock',
  'source.monitor-interval' = '10 sec',
  'connector' = 'filesystem'
)
LIKE `_Orders__schema`
=== _Product
ID:          default_catalog.default_database._Product
Type:        stream
Stage:       flink
Primary key: productid, name, description, category
Timestamp:   _ingest_time
Row count:   ~1e8
---
Schema:
 - productid: BIGINT NOT NULL
 - name: VARCHAR(2147483647) CHARACTER SET "UTF-16LE" NOT NULL
 - description: VARCHAR(2147483647) CHARACTER SET "UTF-16LE" NOT NULL
 - category: VARCHAR(2147483647) CHARACTER SET "UTF-16LE" NOT NULL
 - _ingest_time: TIMESTAMP_LTZ(3) *ROWTIME* NOT NULL
Inputs:
 - default_catalog.default_database._Product__base
Annotations:
 - stream-root: _Product
Plan:
LogicalWatermarkAssigner(rowtime=[_ingest_time], watermark=[-($4, 1:INTERVAL SECOND)])
  LogicalTableScan(table=[[default_catalog, default_database, _Product]])
SQL:
CREATE TEMPORARY TABLE `_Product__schema` (
  `productid` BIGINT NOT NULL,
  `name` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,
  `description` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,
  `category` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,
  `_ingest_time` TIMESTAMP(3) WITH LOCAL TIME ZONE NOT NULL
)
WITH (
  'connector' = 'datagen'
);
CREATE TABLE `_Product` (
  PRIMARY KEY (`productid`, `name`, `description`, `category`) NOT ENFORCED,
  WATERMARK FOR `_ingest_time` AS `_ingest_time` - INTERVAL '0.001' SECOND
)
WITH (
  'format' = 'flexible-json',
  'path' = 'file:/mock',
  'source.monitor-interval' = '10 sec',
  'connector' = 'filesystem'
)
LIKE `_Product__schema`
>>>flink-sql-no-functions.sql
CREATE TEMPORARY TABLE `_Orders__schema` (
  `id` BIGINT NOT NULL,
  `customerid` BIGINT NOT NULL,
  `time` TIMESTAMP(3) WITH LOCAL TIME ZONE NOT NULL,
  `entries` ROW(`productid` BIGINT NOT NULL, `quantity` BIGINT NOT NULL, `unit_price` DOUBLE NOT NULL, `discount` DOUBLE) NOT NULL ARRAY NOT NULL
)
WITH (
  'connector' = 'datagen'
);
CREATE TABLE `_Orders` (
  PRIMARY KEY (`id`, `time`) NOT ENFORCED,
  WATERMARK FOR `time` AS `time` - INTERVAL '0.001' SECOND
)
WITH (
  'format' = 'flexible-json',
  'path' = 'file:/mock',
  'source.monitor-interval' = '10 sec',
  'connector' = 'filesystem'
)
LIKE `_Orders__schema`;
CREATE TEMPORARY TABLE `_Product__schema` (
  `productid` BIGINT NOT NULL,
  `name` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,
  `description` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,
  `category` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,
  `_ingest_time` TIMESTAMP(3) WITH LOCAL TIME ZONE NOT NULL
)
WITH (
  'connector' = 'datagen'
);
CREATE TABLE `_Product` (
  PRIMARY KEY (`productid`, `name`, `description`, `category`) NOT ENFORCED,
  WATERMARK FOR `_ingest_time` AS `_ingest_time` - INTERVAL '0.001' SECOND
)
WITH (
  'format' = 'flexible-json',
  'path' = 'file:/mock',
  'source.monitor-interval' = '10 sec',
  'connector' = 'filesystem'
)
LIKE `_Product__schema`;
CREATE TEMPORARY TABLE `Customer__schema` (
  `customerid` BIGINT NOT NULL,
  `email` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,
  `name` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,
  `lastUpdated` BIGINT NOT NULL
)
WITH (
  'connector' = 'datagen'
);
CREATE TABLE `Customer` (
  `timestamp` AS COALESCE(`TO_TIMESTAMP_LTZ`(`lastUpdated`, 0), TIMESTAMP '1970-01-01 00:00:00.000'),
  PRIMARY KEY (`customerid`, `lastUpdated`) NOT ENFORCED,
  WATERMARK FOR `timestamp` AS `timestamp` - INTERVAL '0.001' SECOND
)
WITH (
  'format' = 'flexible-json',
  'path' = 'file:/mock',
  'source.monitor-interval' = '10 sec',
  'connector' = 'filesystem'
)
LIKE `Customer__schema`;
CREATE VIEW `Orders`
AS
SELECT *
FROM `_Orders`;
CREATE VIEW `Product`
AS
SELECT *
FROM `_Product`;
CREATE TABLE `Customer_1` (
  `customerid` BIGINT NOT NULL,
  `email` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,
  `name` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,
  `lastUpdated` BIGINT NOT NULL,
  `timestamp` TIMESTAMP(3) WITH LOCAL TIME ZONE NOT NULL,
  PRIMARY KEY (`customerid`, `lastUpdated`) NOT ENFORCED
)
WITH (
  'connector' = 'jdbc-sqrl',
  'driver' = 'org.postgresql.Driver',
  'password' = '${POSTGRES_PASSWORD}',
  'sink.on-conflict.action' = 'IGNORE',
  'table-name' = 'Customer_1',
  'url' = 'jdbc:postgresql://${POSTGRES_AUTHORITY}',
  'username' = '${POSTGRES_USERNAME}'
);
CREATE TABLE `Orders_2` (
  `id` BIGINT NOT NULL,
  `customerid` BIGINT NOT NULL,
  `time` TIMESTAMP(3) WITH LOCAL TIME ZONE NOT NULL,
  `entries` RAW('com.datasqrl.flinkrunner.stdlib.json.FlinkJsonType', 'AERjb20uZGF0YXNxcmwuZmxpbmtydW5uZXIuc3RkbGliLmpzb24uRmxpbmtKc29uVHlwZVNlcmlhbGl6ZXJTbmFwc2hvdAAAAAM='),
  PRIMARY KEY (`id`, `time`) NOT ENFORCED
)
WITH (
  'connector' = 'jdbc-sqrl',
  'driver' = 'org.postgresql.Driver',
  'password' = '${POSTGRES_PASSWORD}',
  'sink.on-conflict.action' = 'IGNORE',
  'table-name' = 'Orders_2',
  'url' = 'jdbc:postgresql://${POSTGRES_AUTHORITY}',
  'username' = '${POSTGRES_USERNAME}'
);
CREATE TABLE `Product_3` (
  `productid` BIGINT NOT NULL,
  `name` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,
  `description` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,
  `category` VARCHAR(2147483647) CHARACTER SET `UTF-16LE` NOT NULL,
  `_ingest_time` TIMESTAMP(3) WITH LOCAL TIME ZONE NOT NULL,
  PRIMARY KEY (`productid`, `name`, `description`, `category`) NOT ENFORCED
)
WITH (
  'connector' = 'jdbc-sqrl',
  'driver' = 'org.postgresql.Driver',
  'password' = '${POSTGRES_PASSWORD}',
  'sink.on-conflict.action' = 'IGNORE',
  'table-name' = 'Product_3',
  'url' = 'jdbc:postgresql://${POSTGRES_AUTHORITY}',
  'username' = '${POSTGRES_USERNAME}'
);
EXECUTE STATEMENT SET BEGIN
INSERT INTO `default_catalog`.`default_database`.`Customer_1`
SELECT *
 FROM `default_catalog`.`default_database`.`Customer`
;
INSERT INTO `default_catalog`.`default_database`.`Orders_2`
 SELECT `id`, `customerid`, `time`, `to_jsonb`(`entries`) AS `entries`
  FROM `default_catalog`.`default_database`.`Orders`
 ;
 INSERT INTO `default_catalog`.`default_database`.`Product_3`
  SELECT *
   FROM `default_catalog`.`default_database`.`Product`
  ;
  END
>>>kafka.json
{
  "topics" : [ ],
  "testRunnerTopics" : [ ]
}
>>>postgres.json
{
  "statements" : [
    {
      "name" : "Customer_1",
      "type" : "TABLE",
      "sql" : "CREATE TABLE IF NOT EXISTS \"Customer_1\" (\"customerid\" BIGINT NOT NULL, \"email\" TEXT NOT NULL, \"name\" TEXT NOT NULL, \"lastUpdated\" BIGINT NOT NULL, \"timestamp\" TIMESTAMP WITH TIME ZONE NOT NULL, PRIMARY KEY (\"customerid\",\"lastUpdated\"))",
      "fields" : [
        {
          "name" : "customerid",
          "type" : "BIGINT",
          "nullable" : false
        },
        {
          "name" : "email",
          "type" : "TEXT",
          "nullable" : false
        },
        {
          "name" : "name",
          "type" : "TEXT",
          "nullable" : false
        },
        {
          "name" : "lastUpdated",
          "type" : "BIGINT",
          "nullable" : false
        },
        {
          "name" : "timestamp",
          "type" : "TIMESTAMP WITH TIME ZONE",
          "nullable" : false
        }
      ],
      "primaryKey" : [
        "customerid",
        "lastUpdated"
      ],
      "partitionKey" : [ ],
      "partitionType" : "NONE",
      "numPartitions" : 0,
      "ttl" : 0.0
    },
    {
      "name" : "Orders_2",
      "type" : "TABLE",
      "sql" : "CREATE TABLE IF NOT EXISTS \"Orders_2\" (\"id\" BIGINT NOT NULL, \"customerid\" BIGINT NOT NULL, \"time\" TIMESTAMP WITH TIME ZONE NOT NULL, \"entries\" JSONB, PRIMARY KEY (\"id\",\"time\"))",
      "fields" : [
        {
          "name" : "id",
          "type" : "BIGINT",
          "nullable" : false
        },
        {
          "name" : "customerid",
          "type" : "BIGINT",
          "nullable" : false
        },
        {
          "name" : "time",
          "type" : "TIMESTAMP WITH TIME ZONE",
          "nullable" : false
        },
        {
          "name" : "entries",
          "type" : "JSONB",
          "nullable" : true
        }
      ],
      "primaryKey" : [
        "id",
        "time"
      ],
      "partitionKey" : [ ],
      "partitionType" : "NONE",
      "numPartitions" : 0,
      "ttl" : 0.0
    },
    {
      "name" : "Product_3",
      "type" : "TABLE",
      "sql" : "CREATE TABLE IF NOT EXISTS \"Product_3\" (\"productid\" BIGINT NOT NULL, \"name\" TEXT NOT NULL, \"description\" TEXT NOT NULL, \"category\" TEXT NOT NULL, \"_ingest_time\" TIMESTAMP WITH TIME ZONE NOT NULL, PRIMARY KEY (\"productid\",\"name\",\"description\",\"category\"))",
      "fields" : [
        {
          "name" : "productid",
          "type" : "BIGINT",
          "nullable" : false
        },
        {
          "name" : "name",
          "type" : "TEXT",
          "nullable" : false
        },
        {
          "name" : "description",
          "type" : "TEXT",
          "nullable" : false
        },
        {
          "name" : "category",
          "type" : "TEXT",
          "nullable" : false
        },
        {
          "name" : "_ingest_time",
          "type" : "TIMESTAMP WITH TIME ZONE",
          "nullable" : false
        }
      ],
      "primaryKey" : [
        "productid",
        "name",
        "description",
        "category"
      ],
      "partitionKey" : [ ],
      "partitionType" : "NONE",
      "numPartitions" : 0,
      "ttl" : 0.0
    },
    {
      "name" : "Customer",
      "type" : "VIEW",
      "sql" : "CREATE OR REPLACE VIEW \"Customer\"(\"customerid\", \"email\", \"name\", \"lastUpdated\", \"timestamp\") AS SELECT *\nFROM \"Customer_1\"",
      "fields" : [
        {
          "name" : "customerid",
          "type" : "BIGINT",
          "nullable" : false
        },
        {
          "name" : "email",
          "type" : "TEXT",
          "nullable" : false
        },
        {
          "name" : "name",
          "type" : "TEXT",
          "nullable" : false
        },
        {
          "name" : "lastUpdated",
          "type" : "BIGINT",
          "nullable" : false
        },
        {
          "name" : "timestamp",
          "type" : "TIMESTAMP WITH TIME ZONE",
          "nullable" : false
        }
      ]
    },
    {
      "name" : "Orders_2_btree_c1c2",
      "type" : "INDEX",
      "sql" : "CREATE INDEX IF NOT EXISTS \"Orders_2_btree_c1c2\" ON \"Orders_2\" USING btree (\"customerid\",\"time\")"
    },
    {
      "name" : "Product_3_btree_c1c2c3",
      "type" : "INDEX",
      "sql" : "CREATE INDEX IF NOT EXISTS \"Product_3_btree_c1c2c3\" ON \"Product_3\" USING btree (\"name\",\"description\",\"category\")"
    },
    {
      "name" : "Product_3_btree_c1c3",
      "type" : "INDEX",
      "sql" : "CREATE INDEX IF NOT EXISTS \"Product_3_btree_c1c3\" ON \"Product_3\" USING btree (\"name\",\"category\")"
    },
    {
      "name" : "Product_3_btree_c2c3c4",
      "type" : "INDEX",
      "sql" : "CREATE INDEX IF NOT EXISTS \"Product_3_btree_c2c3c4\" ON \"Product_3\" USING btree (\"description\",\"category\",\"_ingest_time\")"
    },
    {
      "name" : "Product_3_btree_c2c4c1",
      "type" : "INDEX",
      "sql" : "CREATE INDEX IF NOT EXISTS \"Product_3_btree_c2c4c1\" ON \"Product_3\" USING btree (\"description\",\"_ingest_time\",\"name\")"
    },
    {
      "name" : "Product_3_btree_c3c4c1",
      "type" : "INDEX",
      "sql" : "CREATE INDEX IF NOT EXISTS \"Product_3_btree_c3c4c1\" ON \"Product_3\" USING btree (\"category\",\"_ingest_time\",\"name\")"
    },
    {
      "name" : "Product_3_btree_c4c1",
      "type" : "INDEX",
      "sql" : "CREATE INDEX IF NOT EXISTS \"Product_3_btree_c4c1\" ON \"Product_3\" USING btree (\"_ingest_time\",\"name\")"
    }
  ]
}
>>>vertx.json
{
  "models" : {
    "v1" : {
      "queries" : [
        {
          "type" : "args",
          "parentType" : "Query",
          "fieldName" : "Customer",
          "exec" : {
            "arguments" : [
              {
                "type" : "variable",
                "path" : "limit"
              },
              {
                "type" : "variable",
                "path" : "offset"
              }
            ],
            "query" : {
              "type" : "SqlQuery",
              "sql" : "SELECT *\nFROM \"Customer_1\"",
              "parameters" : [ ],
              "pagination" : "LIMIT_AND_OFFSET",
              "cacheDurationMs" : 0,
              "database" : "POSTGRES"
            }
          }
        },
        {
          "type" : "args",
          "parentType" : "Customer",
          "fieldName" : "orders",
          "exec" : {
            "arguments" : [
              {
                "type" : "variable",
                "path" : "limit"
              },
              {
                "type" : "variable",
                "path" : "offset"
              }
            ],
            "query" : {
              "type" : "SqlQuery",
              "sql" : "SELECT *\nFROM \"Orders_2\"\nWHERE \"customerid\" = $1",
              "parameters" : [
                {
                  "type" : "source",
                  "key" : "customerid"
                }
              ],
              "pagination" : "LIMIT_AND_OFFSET",
              "cacheDurationMs" : 0,
              "database" : "POSTGRES"
            }
          }
        },
        {
          "type" : "args",
          "parentType" : "Query",
          "fieldName" : "Orders",
          "exec" : {
            "arguments" : [
              {
                "type" : "variable",
                "path" : "customerid"
              },
              {
                "type" : "variable",
                "path" : "limit"
              },
              {
                "type" : "variable",
                "path" : "offset"
              },
              {
                "type" : "variable",
                "path" : "time"
              }
            ],
            "query" : {
              "type" : "SqlQuery",
              "sql" : "SELECT *\nFROM \"Orders_2\"\nWHERE \"time\" = $1 AND \"customerid\" = $2",
              "parameters" : [
                {
                  "type" : "arg",
                  "path" : "time",
                  "sqlType" : "TIMESTAMP_WITH_LOCAL_TIME_ZONE"
                },
                {
                  "type" : "arg",
                  "path" : "customerid",
                  "sqlType" : "BIGINT"
                }
              ],
              "pagination" : "LIMIT_AND_OFFSET",
              "cacheDurationMs" : 0,
              "database" : "POSTGRES"
            }
          }
        },
        {
          "type" : "args",
          "parentType" : "Query",
          "fieldName" : "Product",
          "exec" : {
            "arguments" : [
              {
                "type" : "variable",
                "path" : "description"
              },
              {
                "type" : "variable",
                "path" : "_ingest_time"
              },
              {
                "type" : "variable",
                "path" : "name"
              },
              {
                "type" : "variable",
                "path" : "limit"
              },
              {
                "type" : "variable",
                "path" : "offset"
              },
              {
                "type" : "variable",
                "path" : "category"
              }
            ],
            "query" : {
              "type" : "SqlQuery",
              "sql" : "SELECT *\nFROM \"Product_3\"\nWHERE (\"name\" = $1 OR $1 IS NULL) AND (\"description\" = $2 OR $2 IS NULL) AND (\"category\" = $3 OR $3 IS NULL) AND (\"_ingest_time\" = $4 OR $4 IS NULL)",
              "parameters" : [
                {
                  "type" : "arg",
                  "path" : "name",
                  "sqlType" : "VARCHAR"
                },
                {
                  "type" : "arg",
                  "path" : "description",
                  "sqlType" : "VARCHAR"
                },
                {
                  "type" : "arg",
                  "path" : "category",
                  "sqlType" : "VARCHAR"
                },
                {
                  "type" : "arg",
                  "path" : "_ingest_time",
                  "sqlType" : "TIMESTAMP_WITH_LOCAL_TIME_ZONE"
                }
              ],
              "pagination" : "LIMIT_AND_OFFSET",
              "cacheDurationMs" : 0,
              "database" : "POSTGRES"
            }
          }
        },
        {
          "type" : "args",
          "parentType" : "Query",
          "fieldName" : "OrdersById",
          "exec" : {
            "arguments" : [
              {
                "type" : "variable",
                "path" : "limit"
              },
              {
                "type" : "variable",
                "path" : "id"
              },
              {
                "type" : "variable",
                "path" : "offset"
              }
            ],
            "query" : {
              "type" : "SqlQuery",
              "sql" : "SELECT *\nFROM \"Orders_2\"\nWHERE $1 = \"id\"",
              "parameters" : [
                {
                  "type" : "arg",
                  "path" : "id",
                  "sqlType" : "BIGINT"
                }
              ],
              "pagination" : "LIMIT_AND_OFFSET",
              "cacheDurationMs" : 0,
              "database" : "POSTGRES"
            }
          }
        },
        {
          "type" : "args",
          "parentType" : "Query",
          "fieldName" : "OrdersByTime",
          "exec" : {
            "arguments" : [
              {
                "type" : "variable",
                "path" : "customerid"
              },
              {
                "type" : "variable",
                "path" : "limit"
              },
              {
                "type" : "variable",
                "path" : "offset"
              },
              {
                "type" : "variable",
                "path" : "time"
              }
            ],
            "query" : {
              "type" : "SqlQuery",
              "sql" : "SELECT *\nFROM \"Orders_2\"\nWHERE \"time\" > $1 AND \"customerid\" = $2",
              "parameters" : [
                {
                  "type" : "arg",
                  "path" : "time",
                  "sqlType" : "TIMESTAMP_WITH_LOCAL_TIME_ZONE"
                },
                {
                  "type" : "arg",
                  "path" : "customerid",
                  "sqlType" : "BIGINT"
                }
              ],
              "pagination" : "LIMIT_AND_OFFSET",
              "cacheDurationMs" : 0,
              "database" : "POSTGRES"
            }
          }
        }
      ],
      "mutations" : [ ],
      "subscriptions" : [ ],
      "operations" : [
        {
          "function" : {
            "name" : "GetCustomer",
            "parameters" : {
              "type" : "object",
              "properties" : {
                "orders_limit" : {
                  "type" : "integer"
                },
                "offset" : {
                  "type" : "integer"
                },
                "limit" : {
                  "type" : "integer"
                },
                "orders_offset" : {
                  "type" : "integer"
                }
              },
              "required" : [ ]
            }
          },
          "format" : "JSON",
          "apiQuery" : {
            "query" : "query Customer($limit: Int = 10, $offset: Int = 0$orders_limit: Int = 10, $orders_offset: Int = 0) {\nCustomer(limit: $limit, offset: $offset) {\ncustomerid\nemail\nname\nlastUpdated\ntimestamp\norders(limit: $orders_limit, offset: $orders_offset) {\nid\ncustomerid\ntime\nentries {\nproductid\nquantity\nunit_price\ndiscount\n}\n}\n}\n\n}",
            "queryName" : "Customer",
            "operationType" : "QUERY"
          },
          "mcpMethod" : "TOOL",
          "restMethod" : "GET",
          "uriTemplate" : "queries/Customer{?orders_limit,offset,limit,orders_offset}"
        },
        {
          "function" : {
            "name" : "GetOrders",
            "parameters" : {
              "type" : "object",
              "properties" : {
                "offset" : {
                  "type" : "integer"
                },
                "customerid" : {
                  "type" : "integer"
                },
                "limit" : {
                  "type" : "integer"
                },
                "time" : {
                  "type" : "string"
                }
              },
              "required" : [
                "time",
                "customerid"
              ]
            }
          },
          "format" : "JSON",
          "apiQuery" : {
            "query" : "query Orders($time: DateTime!, $customerid: Long!, $limit: Int = 10, $offset: Int = 0) {\nOrders(time: $time, customerid: $customerid, limit: $limit, offset: $offset) {\nid\ncustomerid\ntime\nentries {\nproductid\nquantity\nunit_price\ndiscount\n}\n}\n\n}",
            "queryName" : "Orders",
            "operationType" : "QUERY"
          },
          "mcpMethod" : "TOOL",
          "restMethod" : "GET",
          "uriTemplate" : "queries/Orders{?offset,customerid,limit,time}"
        },
        {
          "function" : {
            "name" : "GetProduct",
            "parameters" : {
              "type" : "object",
              "properties" : {
                "offset" : {
                  "type" : "integer"
                },
                "name" : {
                  "type" : "string"
                },
                "limit" : {
                  "type" : "integer"
                },
                "description" : {
                  "type" : "string"
                },
                "category" : {
                  "type" : "string"
                },
                "_ingest_time" : {
                  "type" : "string"
                }
              },
              "required" : [ ]
            }
          },
          "format" : "JSON",
          "apiQuery" : {
            "query" : "query Product($name: String, $description: String, $category: String, $_ingest_time: DateTime, $limit: Int = 10, $offset: Int = 0) {\nProduct(name: $name, description: $description, category: $category, _ingest_time: $_ingest_time, limit: $limit, offset: $offset) {\nproductid\nname\ndescription\ncategory\n}\n\n}",
            "queryName" : "Product",
            "operationType" : "QUERY"
          },
          "mcpMethod" : "TOOL",
          "restMethod" : "GET",
          "uriTemplate" : "queries/Product{?offset,name,limit,description,category,_ingest_time}"
        },
        {
          "function" : {
            "name" : "GetOrdersById",
            "parameters" : {
              "type" : "object",
              "properties" : {
                "offset" : {
                  "type" : "integer"
                },
                "limit" : {
                  "type" : "integer"
                },
                "id" : {
                  "type" : "integer"
                }
              },
              "required" : [
                "id"
              ]
            }
          },
          "format" : "JSON",
          "apiQuery" : {
            "query" : "query OrdersById($id: Long!, $limit: Int = 10, $offset: Int = 0) {\nOrdersById(id: $id, limit: $limit, offset: $offset) {\nid\ncustomerid\ntime\nentries {\nproductid\nquantity\nunit_price\ndiscount\n}\n}\n\n}",
            "queryName" : "OrdersById",
            "operationType" : "QUERY"
          },
          "mcpMethod" : "TOOL",
          "restMethod" : "GET",
          "uriTemplate" : "queries/OrdersById{?offset,limit,id}"
        },
        {
          "function" : {
            "name" : "GetOrdersByTime",
            "parameters" : {
              "type" : "object",
              "properties" : {
                "offset" : {
                  "type" : "integer"
                },
                "customerid" : {
                  "type" : "integer"
                },
                "limit" : {
                  "type" : "integer"
                },
                "time" : {
                  "type" : "string"
                }
              },
              "required" : [
                "time",
                "customerid"
              ]
            }
          },
          "format" : "JSON",
          "apiQuery" : {
            "query" : "query OrdersByTime($time: DateTime!, $customerid: Long!, $limit: Int = 10, $offset: Int = 0) {\nOrdersByTime(time: $time, customerid: $customerid, limit: $limit, offset: $offset) {\nid\ncustomerid\ntime\nentries {\nproductid\nquantity\nunit_price\ndiscount\n}\n}\n\n}",
            "queryName" : "OrdersByTime",
            "operationType" : "QUERY"
          },
          "mcpMethod" : "TOOL",
          "restMethod" : "GET",
          "uriTemplate" : "queries/OrdersByTime{?offset,customerid,limit,time}"
        }
      ],
      "schema" : {
        "type" : "string",
        "schema" : "type Customer {\n  customerid: Long!\n  email: String!\n  name: String!\n  lastUpdated: Long!\n  timestamp: DateTime!\n  orders(limit: Int = 10, offset: Int = 0): [Orders!]\n}\n\n\"An RFC-3339 compliant Full Date Scalar\"\nscalar Date\n\n\"A DateTime scalar that handles both full RFC3339 and shorter timestamp formats\"\nscalar DateTime\n\n\"A JSON scalar\"\nscalar JSON\n\n\"24-hour clock time value string in the format `hh:mm:ss` or `hh:mm:ss.sss`.\"\nscalar LocalTime\n\n\"A 64-bit signed integer\"\nscalar Long\n\ntype Orders {\n  id: Long!\n  customerid: Long!\n  time: DateTime!\n  entries: [Orders_entriesOutput]!\n}\n\ntype Orders_entriesOutput {\n  productid: Long!\n  quantity: Long!\n  unit_price: Float!\n  discount: Float\n}\n\ntype Product {\n  productid: Long!\n  name: String!\n  description: String!\n  category: String!\n}\n\ntype Query {\n  Customer(limit: Int = 10, offset: Int = 0): [Customer!]\n  Orders(time: DateTime!, customerid: Long!, limit: Int = 10, offset: Int = 0): [Orders!]\n  Product(name: String, description: String, category: String, _ingest_time: DateTime, limit: Int = 10, offset: Int = 0): [Product!]\n  OrdersById(id: Long!, limit: Int = 10, offset: Int = 0): [Orders!]\n  OrdersByTime(time: DateTime!, customerid: Long!, limit: Int = 10, offset: Int = 0): [Orders!]\n}\n\nenum _McpMethodType {\n  NONE\n  TOOL\n  RESOURCE\n}\n\nenum _RestMethodType {\n  NONE\n  GET\n  POST\n}\n\ndirective @api(mcp: _McpMethodType, rest: _RestMethodType, uri: String) on QUERY | MUTATION | FIELD_DEFINITION\n"
      }
    }
  }
}
