2.0.0 • Published 6 months ago

tinyzod v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

typesafe tinybird functions with zod

  • typesafe
  • tree shakable
  • request caching and revalidation
  • in-built support for zod (support for other validation libs coming in soon...)
  • other cool stuff coming in...
import { z } from 'zod';
import { TinyzodClient, publishEvent, queryPipe } from 'tinyzod';

const tz = new TinyzodClient({
  showLogs: true,
  token: 'TINYBIRD-TOKEN',
  /* other config */
});

const schema = z.object({
  data: z.string(),
  city: z.string(),
});

const response = await publishEvent({
  client: tz,
  schema,
  validator: 'zod',
  datasource: 'demo_v1',
  data: {
    date: '2020-10-04',
    city: 'ontario',
  },
});

const query_ = await queryPipe({
  client: tz,
  pipe: 'demo_pipe__v1',
  query: 'column_01=value',
});
2.0.0

6 months ago

1.0.0

6 months ago

0.1.2

6 months ago

0.1.1

6 months ago

0.1.0

6 months ago