Skip to content

monolayer-pg / schema / integer

Function: integer()

integer(): PgInteger

Column that stores whole numbers.

Returns

PgInteger

Remarks

Range: -2147483648 to +2147483647. Kysely database schema type definition

ts
{
  readonly __select__: number | null;
  readonly __insert__: number | string | null | undefined;
  readonly __update__: number | string | null;
};

Nullability and optionality will change according to the column's constraints, generated values, and default data values.

Example

ts
import { integer, schema, table } from "@monolayer/pg/schema";

const dbSchema = schema({
  tables: {
    example: table({
      columns: {
        id: integer(),
      },
    }),
  },
});

// Kysely database schema type
type DB = typeof dbSchema.infer;

See

PostgreSQL Docs: integer