CREATE TYPE public.item_status AS ENUM ('active', 'archived');
CREATE TYPE public.point_2d AS (x numeric, y numeric);
CREATE TABLE public.orders (
    id    bigint NOT NULL,
    email text
);
CREATE VIEW public.active_orders AS
    SELECT id, email FROM public.orders WHERE id > 0;
CREATE FUNCTION public.count_orders() RETURNS bigint
    LANGUAGE sql AS $$ SELECT count(*) FROM public.orders $$;
