MCPcopy
hub / github.com/drizzle-team/drizzle-orm / tests

Function tests

integration-tests/tests/pg/pg-common.ts:398–6544  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

396});
397
398export function tests() {
399 describe('common', () => {
400 beforeEach(async (ctx) => {
401 const { db } = ctx.pg;
402 await db.execute(sql`drop schema if exists public cascade`);
403 await db.execute(sql`drop schema if exists ${mySchema} cascade`);
404 await db.execute(sql`create schema public`);
405 await db.execute(sql`create schema if not exists custom_migrations`);
406 await db.execute(sql`create schema ${mySchema}`);
407 // public users
408 await db.execute(
409 sql`
410 create table users (
411 id serial primary key,
412 name text not null,
413 verified boolean not null default false,
414 jsonb jsonb,
415 created_at timestamptz not null default now()
416 )
417 `,
418 );
419 // public cities
420 await db.execute(
421 sql`
422 create table cities (
423 id serial primary key,
424 name text not null,
425 state char(2)
426 )
427 `,
428 );
429 // public users2
430 await db.execute(
431 sql`
432 create table users2 (
433 id serial primary key,
434 name text not null,
435 city_id integer references cities(id)
436 )
437 `,
438 );
439 await db.execute(
440 sql`
441 create table course_categories (
442 id serial primary key,
443 name text not null
444 )
445 `,
446 );
447 await db.execute(
448 sql`
449 create table courses (
450 id serial primary key,
451 name text not null,
452 category_id integer references course_categories(id)
453 )
454 `,
455 );

Callers 2

vercel-pg.test.tsFile · 0.90
xata-http.test.tsFile · 0.90

Calls 15

sqlToQueryMethod · 0.95
sqlFunction · 0.90
pgTableFunction · 0.90
serialFunction · 0.90
textFunction · 0.90
charFunction · 0.90
uniqueFunction · 0.90
getTableConfigFunction · 0.90
uniqueKeyNameFunction · 0.90
foreignKeyFunction · 0.90
primaryKeyFunction · 0.90
inArrayFunction · 0.90

Tested by

no test coverage detected