-- test data generated by codex to test various data types
CREATE TYPE mood AS ENUM ('sad', 'ok', 'happy');

CREATE TABLE duckdb_all_types (
  id              INTEGER,
  bool_col        BOOLEAN,
  tinyint_col     TINYINT,
  smallint_col    SMALLINT,
  int_col         INTEGER,
  bigint_col      BIGINT,
  hugeint_col     HUGEINT,
  utinyint_col    UTINYINT,
  usmallint_col   USMALLINT,
  uint_col        UINTEGER,
  ubigint_col     UBIGINT,
  float_col       FLOAT,
  double_col      DOUBLE,
  decimal_col     DECIMAL(18, 4),
  timestamp_col   TIMESTAMP,
  timestamp_ms_col TIMESTAMP_MS,
  timestamp_ns_col TIMESTAMP_NS,
  date_col        DATE,
  time_col        TIME,
  interval_col    INTERVAL,
  text_col        VARCHAR,
  blob_col        BLOB,
  list_col        INTEGER[],
  array_col       INTEGER[3],
  enum_col        mood,
  struct_col      STRUCT(a INTEGER, b VARCHAR),
  map_col         MAP(VARCHAR, INTEGER),
  union_col       UNION(num INT, txt VARCHAR)
);

INSERT INTO duckdb_all_types VALUES (
  1,
  TRUE,
  -5,
  -30000,
  123456,
  1234567890123,
  hugeint '123456789012345678901234567890',
  250,
  65000,
  4294967295,
  18446744073709551615,
  3.14,
  2.718281828,
  12345.6789,
  TIMESTAMP     '2024-05-01 12:34:56',
  TIMESTAMP  '2024-05-01 12:34:56.789',
  TIMESTAMP  '2024-05-01 12:34:56.789123456',
  DATE          '2024-05-01',
  TIME          '12:34:56.789123',
  INTERVAL      '1 year 2 months 3 days 4 hours 5 minutes 6 seconds',
  'Hello, world!',
  BLOB '\xDEADBEEF',
  [1, 2, 3],
  [4, 5, 6],
  'happy',
  {'a': 42, 'b': 'nested'},
  map { 'alpha': 10, 'beta': 20 },
  union_value(num := 999)::UNION(num INT, txt VARCHAR)
);

-- Views for testing
CREATE VIEW duckdb_numeric_snapshot AS
SELECT id,
       int_col,
       bigint_col,
       hugeint_col,
       decimal_col
FROM duckdb_all_types;

CREATE VIEW duckdb_text_snapshot AS
SELECT id,
       text_col,
       enum_col,
       struct_col
FROM duckdb_all_types;
