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

Function tests

integration-tests/tests/singlestore/singlestore-common.ts:301–4788  ·  view source on GitHub ↗
(driver?: string)

Source from the content-addressed store, hash-verified

299}
300
301export function tests(driver?: string) {
302 describe('common', () => {
303 afterAll(async () => {
304 await singlestoreContainer?.stop().catch(console.error);
305 });
306
307 beforeEach(async (ctx) => {
308 const { db } = ctx.singlestore;
309 await db.execute(sql`drop table if exists userstest`);
310 await db.execute(sql`drop table if exists users2`);
311 await db.execute(sql`drop table if exists cities`);
312 await db.execute(sql`drop table if exists ${allTypesTable}`);
313
314 await db.execute(sql`drop schema if exists \`mySchema\``);
315 await db.execute(sql`create schema if not exists \`mySchema\``);
316
317 await db.execute(
318 sql`
319 create table userstest (
320 id serial primary key,
321 name text not null,
322 verified boolean not null default false,
323 jsonb json,
324 created_at timestamp not null default now()
325 )
326 `,
327 );
328
329 await db.execute(
330 sql`
331 create table users2 (
332 id serial primary key,
333 name text not null,
334 city_id int
335 )
336 `,
337 );
338
339 await db.execute(
340 sql`
341 create table cities (
342 id serial primary key,
343 name text not null
344 )
345 `,
346 );
347
348 // mySchema
349 await db.execute(
350 sql`
351 create table \`mySchema\`.\`userstest\` (
352 \`id\` serial primary key,
353 \`name\` text not null,
354 \`verified\` boolean not null default false,
355 \`jsonb\` json,
356 \`created_at\` timestamp not null default now()
357 )
358 `,

Callers 2

Calls 15

sqlToQueryMethod · 0.95
sqlFunction · 0.90
singlestoreTableFunction · 0.90
bigintFunction · 0.90
intFunction · 0.90
smallintFunction · 0.90
mediumintFunction · 0.90
tinyintFunction · 0.90
getTableConfigFunction · 0.90
serialFunction · 0.90
textFunction · 0.90
primaryKeyFunction · 0.90

Tested by

no test coverage detected