Skip to content
Migrating from NextAuth.js v4? Read our migration guide.
API reference
lib
Pg

lib/pg

DefaultPostgresAccountsTable

type DefaultPostgresAccountsTable: PgTableWithColumns<{
  columns: {
     access_token: DefaultPostgresColumn<{
        columnType: "PgVarchar" | "PgText";
        data: string;
        dataType: "string";
        notNull: boolean;
     }>;
     expires_at: DefaultPostgresColumn<{
        columnType: "PgInteger";
        data: number;
        dataType: "number";
        notNull: boolean;
     }>;
     id_token: DefaultPostgresColumn<{
        columnType: "PgVarchar" | "PgText";
        data: string;
        dataType: "string";
        notNull: boolean;
     }>;
     provider: DefaultPostgresColumn<{
        columnType: "PgVarchar" | "PgText";
        data: string;
        dataType: "string";
        notNull: true;
     }>;
     providerAccountId: DefaultPostgresColumn<{
        columnType: "PgVarchar" | "PgText";
        data: string;
        dataType: "string";
        notNull: true;
     }>;
     refresh_token: DefaultPostgresColumn<{
        columnType: "PgVarchar" | "PgText";
        data: string;
        dataType: "string";
        notNull: boolean;
     }>;
     scope: DefaultPostgresColumn<{
        columnType: "PgVarchar" | "PgText";
        data: string;
        dataType: "string";
        notNull: boolean;
     }>;
     session_state: DefaultPostgresColumn<{
        columnType: "PgVarchar" | "PgText";
        data: string;
        dataType: "string";
        notNull: boolean;
     }>;
     token_type: DefaultPostgresColumn<{
        columnType: "PgVarchar" | "PgText";
        data: string;
        dataType: "string";
        notNull: boolean;
     }>;
     type: DefaultPostgresColumn<{
        columnType: "PgVarchar" | "PgText";
        data: string;
        dataType: "string";
        notNull: true;
     }>;
     userId: DefaultPostgresColumn<{
        columnType: "PgVarchar" | "PgText" | "PgUUID";
        data: string;
        dataType: "string";
        notNull: true;
     }>;
  };
  dialect: "pg";
  name: string;
  schema: string | undefined;
}>;

Type declaration

columns

columns: {
  access_token: DefaultPostgresColumn<{
     columnType: "PgVarchar" | "PgText";
     data: string;
     dataType: "string";
     notNull: boolean;
  }>;
  expires_at: DefaultPostgresColumn<{
     columnType: "PgInteger";
     data: number;
     dataType: "number";
     notNull: boolean;
  }>;
  id_token: DefaultPostgresColumn<{
     columnType: "PgVarchar" | "PgText";
     data: string;
     dataType: "string";
     notNull: boolean;
  }>;
  provider: DefaultPostgresColumn<{
     columnType: "PgVarchar" | "PgText";
     data: string;
     dataType: "string";
     notNull: true;
  }>;
  providerAccountId: DefaultPostgresColumn<{
     columnType: "PgVarchar" | "PgText";
     data: string;
     dataType: "string";
     notNull: true;
  }>;
  refresh_token: DefaultPostgresColumn<{
     columnType: "PgVarchar" | "PgText";
     data: string;
     dataType: "string";
     notNull: boolean;
  }>;
  scope: DefaultPostgresColumn<{
     columnType: "PgVarchar" | "PgText";
     data: string;
     dataType: "string";
     notNull: boolean;
  }>;
  session_state: DefaultPostgresColumn<{
     columnType: "PgVarchar" | "PgText";
     data: string;
     dataType: "string";
     notNull: boolean;
  }>;
  token_type: DefaultPostgresColumn<{
     columnType: "PgVarchar" | "PgText";
     data: string;
     dataType: "string";
     notNull: boolean;
  }>;
  type: DefaultPostgresColumn<{
     columnType: "PgVarchar" | "PgText";
     data: string;
     dataType: "string";
     notNull: true;
  }>;
  userId: DefaultPostgresColumn<{
     columnType: "PgVarchar" | "PgText" | "PgUUID";
     data: string;
     dataType: "string";
     notNull: true;
  }>;
};

columns.access_token

access_token: DefaultPostgresColumn<{
  columnType: "PgVarchar" | "PgText";
  data: string;
  dataType: "string";
  notNull: boolean;
}>;
Type declaration
columnType
columnType: "PgVarchar" | "PgText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: boolean;

columns.expires_at

expires_at: DefaultPostgresColumn<{
  columnType: "PgInteger";
  data: number;
  dataType: "number";
  notNull: boolean;
}>;
Type declaration
columnType
columnType: "PgInteger";
data
data: number;
dataType
dataType: "number";
notNull
notNull: boolean;

columns.id_token

id_token: DefaultPostgresColumn<{
  columnType: "PgVarchar" | "PgText";
  data: string;
  dataType: "string";
  notNull: boolean;
}>;
Type declaration
columnType
columnType: "PgVarchar" | "PgText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: boolean;

columns.provider

provider: DefaultPostgresColumn<{
  columnType: "PgVarchar" | "PgText";
  data: string;
  dataType: "string";
  notNull: true;
}>;
Type declaration
columnType
columnType: "PgVarchar" | "PgText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: true;

columns.providerAccountId

providerAccountId: DefaultPostgresColumn<{
  columnType: "PgVarchar" | "PgText";
  data: string;
  dataType: "string";
  notNull: true;
}>;
Type declaration
columnType
columnType: "PgVarchar" | "PgText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: true;

columns.refresh_token

refresh_token: DefaultPostgresColumn<{
  columnType: "PgVarchar" | "PgText";
  data: string;
  dataType: "string";
  notNull: boolean;
}>;
Type declaration
columnType
columnType: "PgVarchar" | "PgText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: boolean;

columns.scope

scope: DefaultPostgresColumn<{
  columnType: "PgVarchar" | "PgText";
  data: string;
  dataType: "string";
  notNull: boolean;
}>;
Type declaration
columnType
columnType: "PgVarchar" | "PgText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: boolean;

columns.session_state

session_state: DefaultPostgresColumn<{
  columnType: "PgVarchar" | "PgText";
  data: string;
  dataType: "string";
  notNull: boolean;
}>;
Type declaration
columnType
columnType: "PgVarchar" | "PgText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: boolean;

columns.token_type

token_type: DefaultPostgresColumn<{
  columnType: "PgVarchar" | "PgText";
  data: string;
  dataType: "string";
  notNull: boolean;
}>;
Type declaration
columnType
columnType: "PgVarchar" | "PgText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: boolean;

columns.type

type: DefaultPostgresColumn<{
  columnType: "PgVarchar" | "PgText";
  data: string;
  dataType: "string";
  notNull: true;
}>;
Type declaration
columnType
columnType: "PgVarchar" | "PgText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: true;

columns.userId

userId: DefaultPostgresColumn<{
  columnType: "PgVarchar" | "PgText" | "PgUUID";
  data: string;
  dataType: "string";
  notNull: true;
}>;
Type declaration
columnType
columnType: "PgVarchar" | "PgText" | "PgUUID";
data
data: string;
dataType
dataType: "string";
notNull
notNull: true;

dialect

dialect: "pg";

name

name: string;

schema

schema: string | undefined;

DefaultPostgresSchema

type DefaultPostgresSchema: {
  accountsTable: DefaultPostgresAccountsTable;
  sessionsTable: DefaultPostgresSessionsTable;
  usersTable: DefaultPostgresUsersTable;
  verificationTokensTable: DefaultPostgresVerificationTokenTable;
};

Type declaration

accountsTable

accountsTable: DefaultPostgresAccountsTable;

sessionsTable

sessionsTable: DefaultPostgresSessionsTable;

usersTable

usersTable: DefaultPostgresUsersTable;

verificationTokensTable

verificationTokensTable: DefaultPostgresVerificationTokenTable;

DefaultPostgresSessionsTable

type DefaultPostgresSessionsTable: PgTableWithColumns<{
  columns: {
     expires: DefaultPostgresColumn<{
        columnType: "PgTimestamp";
        data: Date;
        dataType: "date";
        notNull: true;
     }>;
     sessionToken: DefaultPostgresColumn<{
        columnType: "PgVarchar" | "PgText";
        data: string;
        dataType: "string";
        notNull: true;
     }>;
     userId: DefaultPostgresColumn<{
        columnType: "PgVarchar" | "PgText" | "PgUUID";
        data: string;
        dataType: "string";
        notNull: true;
     }>;
  };
  dialect: "pg";
  name: string;
  schema: string | undefined;
}>;

Type declaration

columns

columns: {
  expires: DefaultPostgresColumn<{
     columnType: "PgTimestamp";
     data: Date;
     dataType: "date";
     notNull: true;
  }>;
  sessionToken: DefaultPostgresColumn<{
     columnType: "PgVarchar" | "PgText";
     data: string;
     dataType: "string";
     notNull: true;
  }>;
  userId: DefaultPostgresColumn<{
     columnType: "PgVarchar" | "PgText" | "PgUUID";
     data: string;
     dataType: "string";
     notNull: true;
  }>;
};

columns.expires

expires: DefaultPostgresColumn<{
  columnType: "PgTimestamp";
  data: Date;
  dataType: "date";
  notNull: true;
}>;
Type declaration
columnType
columnType: "PgTimestamp";
data
data: Date;
dataType
dataType: "date";
notNull
notNull: true;

columns.sessionToken

sessionToken: DefaultPostgresColumn<{
  columnType: "PgVarchar" | "PgText";
  data: string;
  dataType: "string";
  notNull: true;
}>;
Type declaration
columnType
columnType: "PgVarchar" | "PgText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: true;

columns.userId

userId: DefaultPostgresColumn<{
  columnType: "PgVarchar" | "PgText" | "PgUUID";
  data: string;
  dataType: "string";
  notNull: true;
}>;
Type declaration
columnType
columnType: "PgVarchar" | "PgText" | "PgUUID";
data
data: string;
dataType
dataType: "string";
notNull
notNull: true;

dialect

dialect: "pg";

name

name: string;

schema

schema: string | undefined;

DefaultPostgresUsersTable

type DefaultPostgresUsersTable: PgTableWithColumns<{
  columns: {
     email: DefaultPostgresColumn<{
        columnType: "PgVarchar" | "PgText";
        data: string;
        dataType: "string";
        notNull: true;
     }>;
     emailVerified: DefaultPostgresColumn<{
        columnType: "PgTimestamp";
        data: Date;
        dataType: "date";
        notNull: boolean;
     }>;
     id: DefaultPostgresColumn<{
        columnType: "PgVarchar" | "PgText" | "PgUUID";
        data: string;
        dataType: "string";
        notNull: true;
     }>;
     image: DefaultPostgresColumn<{
        columnType: "PgVarchar" | "PgText";
        data: string;
        dataType: "string";
        notNull: boolean;
     }>;
     name: DefaultPostgresColumn<{
        columnType: "PgVarchar" | "PgText";
        data: string;
        dataType: "string";
        notNull: boolean;
     }>;
  };
  dialect: "pg";
  name: string;
  schema: string | undefined;
}>;

Type declaration

columns

columns: {
  email: DefaultPostgresColumn<{
     columnType: "PgVarchar" | "PgText";
     data: string;
     dataType: "string";
     notNull: true;
  }>;
  emailVerified: DefaultPostgresColumn<{
     columnType: "PgTimestamp";
     data: Date;
     dataType: "date";
     notNull: boolean;
  }>;
  id: DefaultPostgresColumn<{
     columnType: "PgVarchar" | "PgText" | "PgUUID";
     data: string;
     dataType: "string";
     notNull: true;
  }>;
  image: DefaultPostgresColumn<{
     columnType: "PgVarchar" | "PgText";
     data: string;
     dataType: "string";
     notNull: boolean;
  }>;
  name: DefaultPostgresColumn<{
     columnType: "PgVarchar" | "PgText";
     data: string;
     dataType: "string";
     notNull: boolean;
  }>;
};

columns.email

email: DefaultPostgresColumn<{
  columnType: "PgVarchar" | "PgText";
  data: string;
  dataType: "string";
  notNull: true;
}>;
Type declaration
columnType
columnType: "PgVarchar" | "PgText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: true;

columns.emailVerified

emailVerified: DefaultPostgresColumn<{
  columnType: "PgTimestamp";
  data: Date;
  dataType: "date";
  notNull: boolean;
}>;
Type declaration
columnType
columnType: "PgTimestamp";
data
data: Date;
dataType
dataType: "date";
notNull
notNull: boolean;

columns.id

id: DefaultPostgresColumn<{
  columnType: "PgVarchar" | "PgText" | "PgUUID";
  data: string;
  dataType: "string";
  notNull: true;
}>;
Type declaration
columnType
columnType: "PgVarchar" | "PgText" | "PgUUID";
data
data: string;
dataType
dataType: "string";
notNull
notNull: true;

columns.image

image: DefaultPostgresColumn<{
  columnType: "PgVarchar" | "PgText";
  data: string;
  dataType: "string";
  notNull: boolean;
}>;
Type declaration
columnType
columnType: "PgVarchar" | "PgText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: boolean;

columns.name

name: DefaultPostgresColumn<{
  columnType: "PgVarchar" | "PgText";
  data: string;
  dataType: "string";
  notNull: boolean;
}>;
Type declaration
columnType
columnType: "PgVarchar" | "PgText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: boolean;

dialect

dialect: "pg";

name

name: string;

schema

schema: string | undefined;

DefaultPostgresVerificationTokenTable

type DefaultPostgresVerificationTokenTable: PgTableWithColumns<{
  columns: {
     expires: DefaultPostgresColumn<{
        columnType: "PgTimestamp";
        data: Date;
        dataType: "date";
        notNull: true;
     }>;
     identifier: DefaultPostgresColumn<{
        columnType: "PgVarchar" | "PgText";
        data: string;
        dataType: "string";
        notNull: true;
     }>;
     token: DefaultPostgresColumn<{
        columnType: "PgVarchar" | "PgText";
        data: string;
        dataType: "string";
        notNull: true;
     }>;
  };
  dialect: "pg";
  name: string;
  schema: string | undefined;
}>;

Type declaration

columns

columns: {
  expires: DefaultPostgresColumn<{
     columnType: "PgTimestamp";
     data: Date;
     dataType: "date";
     notNull: true;
  }>;
  identifier: DefaultPostgresColumn<{
     columnType: "PgVarchar" | "PgText";
     data: string;
     dataType: "string";
     notNull: true;
  }>;
  token: DefaultPostgresColumn<{
     columnType: "PgVarchar" | "PgText";
     data: string;
     dataType: "string";
     notNull: true;
  }>;
};

columns.expires

expires: DefaultPostgresColumn<{
  columnType: "PgTimestamp";
  data: Date;
  dataType: "date";
  notNull: true;
}>;
Type declaration
columnType
columnType: "PgTimestamp";
data
data: Date;
dataType
dataType: "date";
notNull
notNull: true;

columns.identifier

identifier: DefaultPostgresColumn<{
  columnType: "PgVarchar" | "PgText";
  data: string;
  dataType: "string";
  notNull: true;
}>;
Type declaration
columnType
columnType: "PgVarchar" | "PgText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: true;

columns.token

token: DefaultPostgresColumn<{
  columnType: "PgVarchar" | "PgText";
  data: string;
  dataType: "string";
  notNull: true;
}>;
Type declaration
columnType
columnType: "PgVarchar" | "PgText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: true;

dialect

dialect: "pg";

name

name: string;

schema

schema: string | undefined;

postgresAccountsTable

const postgresAccountsTable: PgTableWithColumns<{
  columns: {
     access_token: PgColumn<{
        baseColumn: never;
        columnType: "PgText";
        data: string;
        dataType: "string";
        driverParam: string;
        enumValues: [string, ...string[]];
        hasDefault: false;
        name: "access_token";
        notNull: false;
        tableName: "account";
     }, {}, {}>;
     expires_at: PgColumn<{
        baseColumn: never;
        columnType: "PgInteger";
        data: number;
        dataType: "number";
        driverParam: string | number;
        enumValues: undefined;
        hasDefault: false;
        name: "expires_at";
        notNull: false;
        tableName: "account";
     }, {}, {}>;
     id_token: PgColumn<{
        baseColumn: never;
        columnType: "PgText";
        data: string;
        dataType: "string";
        driverParam: string;
        enumValues: [string, ...string[]];
        hasDefault: false;
        name: "id_token";
        notNull: false;
        tableName: "account";
     }, {}, {}>;
     provider: PgColumn<{
        baseColumn: never;
        columnType: "PgText";
        data: string;
        dataType: "string";
        driverParam: string;
        enumValues: [string, ...string[]];
        hasDefault: false;
        name: "provider";
        notNull: true;
        tableName: "account";
     }, {}, {}>;
     providerAccountId: PgColumn<{
        baseColumn: never;
        columnType: "PgText";
        data: string;
        dataType: "string";
        driverParam: string;
        enumValues: [string, ...string[]];
        hasDefault: false;
        name: "providerAccountId";
        notNull: true;
        tableName: "account";
     }, {}, {}>;
     refresh_token: PgColumn<{
        baseColumn: never;
        columnType: "PgText";
        data: string;
        dataType: "string";
        driverParam: string;
        enumValues: [string, ...string[]];
        hasDefault: false;
        name: "refresh_token";
        notNull: false;
        tableName: "account";
     }, {}, {}>;
     scope: PgColumn<{
        baseColumn: never;
        columnType: "PgText";
        data: string;
        dataType: "string";
        driverParam: string;
        enumValues: [string, ...string[]];
        hasDefault: false;
        name: "scope";
        notNull: false;
        tableName: "account";
     }, {}, {}>;
     session_state: PgColumn<{
        baseColumn: never;
        columnType: "PgText";
        data: string;
        dataType: "string";
        driverParam: string;
        enumValues: [string, ...string[]];
        hasDefault: false;
        name: "session_state";
        notNull: false;
        tableName: "account";
     }, {}, {}>;
     token_type: PgColumn<{
        baseColumn: never;
        columnType: "PgText";
        data: string;
        dataType: "string";
        driverParam: string;
        enumValues: [string, ...string[]];
        hasDefault: false;
        name: "token_type";
        notNull: false;
        tableName: "account";
     }, {}, {}>;
     type: PgColumn<{
        baseColumn: never;
        columnType: "PgText";
        data: "email" | "oidc" | "oauth" | "webauthn";
        dataType: "string";
        driverParam: string;
        enumValues: [string, ...string[]];
        hasDefault: false;
        name: "type";
        notNull: true;
        tableName: "account";
     }, {}, {}>;
     userId: PgColumn<{
        baseColumn: never;
        columnType: "PgText";
        data: string;
        dataType: "string";
        driverParam: string;
        enumValues: [string, ...string[]];
        hasDefault: false;
        name: "userId";
        notNull: true;
        tableName: "account";
     }, {}, {}>;
  };
  dialect: "pg";
  name: "account";
  schema: undefined;
}>;

Type declaration

columns

columns: {
  access_token: PgColumn<{
     baseColumn: never;
     columnType: "PgText";
     data: string;
     dataType: "string";
     driverParam: string;
     enumValues: [string, ...string[]];
     hasDefault: false;
     name: "access_token";
     notNull: false;
     tableName: "account";
  }, {}, {}>;
  expires_at: PgColumn<{
     baseColumn: never;
     columnType: "PgInteger";
     data: number;
     dataType: "number";
     driverParam: string | number;
     enumValues: undefined;
     hasDefault: false;
     name: "expires_at";
     notNull: false;
     tableName: "account";
  }, {}, {}>;
  id_token: PgColumn<{
     baseColumn: never;
     columnType: "PgText";
     data: string;
     dataType: "string";
     driverParam: string;
     enumValues: [string, ...string[]];
     hasDefault: false;
     name: "id_token";
     notNull: false;
     tableName: "account";
  }, {}, {}>;
  provider: PgColumn<{
     baseColumn: never;
     columnType: "PgText";
     data: string;
     dataType: "string";
     driverParam: string;
     enumValues: [string, ...string[]];
     hasDefault: false;
     name: "provider";
     notNull: true;
     tableName: "account";
  }, {}, {}>;
  providerAccountId: PgColumn<{
     baseColumn: never;
     columnType: "PgText";
     data: string;
     dataType: "string";
     driverParam: string;
     enumValues: [string, ...string[]];
     hasDefault: false;
     name: "providerAccountId";
     notNull: true;
     tableName: "account";
  }, {}, {}>;
  refresh_token: PgColumn<{
     baseColumn: never;
     columnType: "PgText";
     data: string;
     dataType: "string";
     driverParam: string;
     enumValues: [string, ...string[]];
     hasDefault: false;
     name: "refresh_token";
     notNull: false;
     tableName: "account";
  }, {}, {}>;
  scope: PgColumn<{
     baseColumn: never;
     columnType: "PgText";
     data: string;
     dataType: "string";
     driverParam: string;
     enumValues: [string, ...string[]];
     hasDefault: false;
     name: "scope";
     notNull: false;
     tableName: "account";
  }, {}, {}>;
  session_state: PgColumn<{
     baseColumn: never;
     columnType: "PgText";
     data: string;
     dataType: "string";
     driverParam: string;
     enumValues: [string, ...string[]];
     hasDefault: false;
     name: "session_state";
     notNull: false;
     tableName: "account";
  }, {}, {}>;
  token_type: PgColumn<{
     baseColumn: never;
     columnType: "PgText";
     data: string;
     dataType: "string";
     driverParam: string;
     enumValues: [string, ...string[]];
     hasDefault: false;
     name: "token_type";
     notNull: false;
     tableName: "account";
  }, {}, {}>;
  type: PgColumn<{
     baseColumn: never;
     columnType: "PgText";
     data: "email" | "oidc" | "oauth" | "webauthn";
     dataType: "string";
     driverParam: string;
     enumValues: [string, ...string[]];
     hasDefault: false;
     name: "type";
     notNull: true;
     tableName: "account";
  }, {}, {}>;
  userId: PgColumn<{
     baseColumn: never;
     columnType: "PgText";
     data: string;
     dataType: "string";
     driverParam: string;
     enumValues: [string, ...string[]];
     hasDefault: false;
     name: "userId";
     notNull: true;
     tableName: "account";
  }, {}, {}>;
};

columns.access_token

access_token: PgColumn<{
  baseColumn: never;
  columnType: "PgText";
  data: string;
  dataType: "string";
  driverParam: string;
  enumValues: [string, ...string[]];
  hasDefault: false;
  name: "access_token";
  notNull: false;
  tableName: "account";
}, {}, {}>;
Type declaration
baseColumn
baseColumn: never;
columnType
columnType: "PgText";
data
data: string;
dataType
dataType: "string";
driverParam
driverParam: string;
enumValues
enumValues: [string, ...string[]];
hasDefault
hasDefault: false;
name
name: "access_token";
notNull
notNull: false;
tableName
tableName: "account";

columns.expires_at

expires_at: PgColumn<{
  baseColumn: never;
  columnType: "PgInteger";
  data: number;
  dataType: "number";
  driverParam: string | number;
  enumValues: undefined;
  hasDefault: false;
  name: "expires_at";
  notNull: false;
  tableName: "account";
}, {}, {}>;
Type declaration
baseColumn
baseColumn: never;
columnType
columnType: "PgInteger";
data
data: number;
dataType
dataType: "number";
driverParam
driverParam: string | number;
enumValues
enumValues: undefined;
hasDefault
hasDefault: false;
name
name: "expires_at";
notNull
notNull: false;
tableName
tableName: "account";

columns.id_token

id_token: PgColumn<{
  baseColumn: never;
  columnType: "PgText";
  data: string;
  dataType: "string";
  driverParam: string;
  enumValues: [string, ...string[]];
  hasDefault: false;
  name: "id_token";
  notNull: false;
  tableName: "account";
}, {}, {}>;
Type declaration
baseColumn
baseColumn: never;
columnType
columnType: "PgText";
data
data: string;
dataType
dataType: "string";
driverParam
driverParam: string;
enumValues
enumValues: [string, ...string[]];
hasDefault
hasDefault: false;
name
name: "id_token";
notNull
notNull: false;
tableName
tableName: "account";

columns.provider

provider: PgColumn<{
  baseColumn: never;
  columnType: "PgText";
  data: string;
  dataType: "string";
  driverParam: string;
  enumValues: [string, ...string[]];
  hasDefault: false;
  name: "provider";
  notNull: true;
  tableName: "account";
}, {}, {}>;
Type declaration
baseColumn
baseColumn: never;
columnType
columnType: "PgText";
data
data: string;
dataType
dataType: "string";
driverParam
driverParam: string;
enumValues
enumValues: [string, ...string[]];
hasDefault
hasDefault: false;
name
name: "provider";
notNull
notNull: true;
tableName
tableName: "account";

columns.providerAccountId

providerAccountId: PgColumn<{
  baseColumn: never;
  columnType: "PgText";
  data: string;
  dataType: "string";
  driverParam: string;
  enumValues: [string, ...string[]];
  hasDefault: false;
  name: "providerAccountId";
  notNull: true;
  tableName: "account";
}, {}, {}>;
Type declaration
baseColumn
baseColumn: never;
columnType
columnType: "PgText";
data
data: string;
dataType
dataType: "string";
driverParam
driverParam: string;
enumValues
enumValues: [string, ...string[]];
hasDefault
hasDefault: false;
name
name: "providerAccountId";
notNull
notNull: true;
tableName
tableName: "account";

columns.refresh_token

refresh_token: PgColumn<{
  baseColumn: never;
  columnType: "PgText";
  data: string;
  dataType: "string";
  driverParam: string;
  enumValues: [string, ...string[]];
  hasDefault: false;
  name: "refresh_token";
  notNull: false;
  tableName: "account";
}, {}, {}>;
Type declaration
baseColumn
baseColumn: never;
columnType
columnType: "PgText";
data
data: string;
dataType
dataType: "string";
driverParam
driverParam: string;
enumValues
enumValues: [string, ...string[]];
hasDefault
hasDefault: false;
name
name: "refresh_token";
notNull
notNull: false;
tableName
tableName: "account";

columns.scope

scope: PgColumn<{
  baseColumn: never;
  columnType: "PgText";
  data: string;
  dataType: "string";
  driverParam: string;
  enumValues: [string, ...string[]];
  hasDefault: false;
  name: "scope";
  notNull: false;
  tableName: "account";
}, {}, {}>;
Type declaration
baseColumn
baseColumn: never;
columnType
columnType: "PgText";
data
data: string;
dataType
dataType: "string";
driverParam
driverParam: string;
enumValues
enumValues: [string, ...string[]];
hasDefault
hasDefault: false;
name
name: "scope";
notNull
notNull: false;
tableName
tableName: "account";

columns.session_state

session_state: PgColumn<{
  baseColumn: never;
  columnType: "PgText";
  data: string;
  dataType: "string";
  driverParam: string;
  enumValues: [string, ...string[]];
  hasDefault: false;
  name: "session_state";
  notNull: false;
  tableName: "account";
}, {}, {}>;
Type declaration
baseColumn
baseColumn: never;
columnType
columnType: "PgText";
data
data: string;
dataType
dataType: "string";
driverParam
driverParam: string;
enumValues
enumValues: [string, ...string[]];
hasDefault
hasDefault: false;
name
name: "session_state";
notNull
notNull: false;
tableName
tableName: "account";

columns.token_type

token_type: PgColumn<{
  baseColumn: never;
  columnType: "PgText";
  data: string;
  dataType: "string";
  driverParam: string;
  enumValues: [string, ...string[]];
  hasDefault: false;
  name: "token_type";
  notNull: false;
  tableName: "account";
}, {}, {}>;
Type declaration
baseColumn
baseColumn: never;
columnType
columnType: "PgText";
data
data: string;
dataType
dataType: "string";
driverParam
driverParam: string;
enumValues
enumValues: [string, ...string[]];
hasDefault
hasDefault: false;
name
name: "token_type";
notNull
notNull: false;
tableName
tableName: "account";

columns.type

type: PgColumn<{
  baseColumn: never;
  columnType: "PgText";
  data: "email" | "oidc" | "oauth" | "webauthn";
  dataType: "string";
  driverParam: string;
  enumValues: [string, ...string[]];
  hasDefault: false;
  name: "type";
  notNull: true;
  tableName: "account";
}, {}, {}>;
Type declaration
baseColumn
baseColumn: never;
columnType
columnType: "PgText";
data
data: "email" | "oidc" | "oauth" | "webauthn";
dataType
dataType: "string";
driverParam
driverParam: string;
enumValues
enumValues: [string, ...string[]];
hasDefault
hasDefault: false;
name
name: "type";
notNull
notNull: true;
tableName
tableName: "account";

columns.userId

userId: PgColumn<{
  baseColumn: never;
  columnType: "PgText";
  data: string;
  dataType: "string";
  driverParam: string;
  enumValues: [string, ...string[]];
  hasDefault: false;
  name: "userId";
  notNull: true;
  tableName: "account";
}, {}, {}>;
Type declaration
baseColumn
baseColumn: never;
columnType
columnType: "PgText";
data
data: string;
dataType
dataType: "string";
driverParam
driverParam: string;
enumValues
enumValues: [string, ...string[]];
hasDefault
hasDefault: false;
name
name: "userId";
notNull
notNull: true;
tableName
tableName: "account";

dialect

dialect: "pg";

name

name: "account";

schema

schema: undefined;

postgresSessionsTable

const postgresSessionsTable: PgTableWithColumns<{
  columns: {
     expires: PgColumn<{
        baseColumn: never;
        columnType: "PgTimestamp";
        data: Date;
        dataType: "date";
        driverParam: string;
        enumValues: undefined;
        hasDefault: false;
        name: "expires";
        notNull: true;
        tableName: "session";
     }, {}, {}>;
     sessionToken: PgColumn<{
        baseColumn: never;
        columnType: "PgText";
        data: string;
        dataType: "string";
        driverParam: string;
        enumValues: [string, ...string[]];
        hasDefault: false;
        name: "sessionToken";
        notNull: true;
        tableName: "session";
     }, {}, {}>;
     userId: PgColumn<{
        baseColumn: never;
        columnType: "PgText";
        data: string;
        dataType: "string";
        driverParam: string;
        enumValues: [string, ...string[]];
        hasDefault: false;
        name: "userId";
        notNull: true;
        tableName: "session";
     }, {}, {}>;
  };
  dialect: "pg";
  name: "session";
  schema: undefined;
}>;

Type declaration

columns

columns: {
  expires: PgColumn<{
     baseColumn: never;
     columnType: "PgTimestamp";
     data: Date;
     dataType: "date";
     driverParam: string;
     enumValues: undefined;
     hasDefault: false;
     name: "expires";
     notNull: true;
     tableName: "session";
  }, {}, {}>;
  sessionToken: PgColumn<{
     baseColumn: never;
     columnType: "PgText";
     data: string;
     dataType: "string";
     driverParam: string;
     enumValues: [string, ...string[]];
     hasDefault: false;
     name: "sessionToken";
     notNull: true;
     tableName: "session";
  }, {}, {}>;
  userId: PgColumn<{
     baseColumn: never;
     columnType: "PgText";
     data: string;
     dataType: "string";
     driverParam: string;
     enumValues: [string, ...string[]];
     hasDefault: false;
     name: "userId";
     notNull: true;
     tableName: "session";
  }, {}, {}>;
};

columns.expires

expires: PgColumn<{
  baseColumn: never;
  columnType: "PgTimestamp";
  data: Date;
  dataType: "date";
  driverParam: string;
  enumValues: undefined;
  hasDefault: false;
  name: "expires";
  notNull: true;
  tableName: "session";
}, {}, {}>;
Type declaration
baseColumn
baseColumn: never;
columnType
columnType: "PgTimestamp";
data
data: Date;
dataType
dataType: "date";
driverParam
driverParam: string;
enumValues
enumValues: undefined;
hasDefault
hasDefault: false;
name
name: "expires";
notNull
notNull: true;
tableName
tableName: "session";

columns.sessionToken

sessionToken: PgColumn<{
  baseColumn: never;
  columnType: "PgText";
  data: string;
  dataType: "string";
  driverParam: string;
  enumValues: [string, ...string[]];
  hasDefault: false;
  name: "sessionToken";
  notNull: true;
  tableName: "session";
}, {}, {}>;
Type declaration
baseColumn
baseColumn: never;
columnType
columnType: "PgText";
data
data: string;
dataType
dataType: "string";
driverParam
driverParam: string;
enumValues
enumValues: [string, ...string[]];
hasDefault
hasDefault: false;
name
name: "sessionToken";
notNull
notNull: true;
tableName
tableName: "session";

columns.userId

userId: PgColumn<{
  baseColumn: never;
  columnType: "PgText";
  data: string;
  dataType: "string";
  driverParam: string;
  enumValues: [string, ...string[]];
  hasDefault: false;
  name: "userId";
  notNull: true;
  tableName: "session";
}, {}, {}>;
Type declaration
baseColumn
baseColumn: never;
columnType
columnType: "PgText";
data
data: string;
dataType
dataType: "string";
driverParam
driverParam: string;
enumValues
enumValues: [string, ...string[]];
hasDefault
hasDefault: false;
name
name: "userId";
notNull
notNull: true;
tableName
tableName: "session";

dialect

dialect: "pg";

name

name: "session";

schema

schema: undefined;

postgresUsersTable

const postgresUsersTable: PgTableWithColumns<{
  columns: {
     email: PgColumn<{
        baseColumn: never;
        columnType: "PgText";
        data: string;
        dataType: "string";
        driverParam: string;
        enumValues: [string, ...string[]];
        hasDefault: false;
        name: "email";
        notNull: true;
        tableName: "user";
     }, {}, {}>;
     emailVerified: PgColumn<{
        baseColumn: never;
        columnType: "PgTimestamp";
        data: Date;
        dataType: "date";
        driverParam: string;
        enumValues: undefined;
        hasDefault: false;
        name: "emailVerified";
        notNull: false;
        tableName: "user";
     }, {}, {}>;
     id: PgColumn<{
        baseColumn: never;
        columnType: "PgText";
        data: string;
        dataType: "string";
        driverParam: string;
        enumValues: [string, ...string[]];
        hasDefault: true;
        name: "id";
        notNull: true;
        tableName: "user";
     }, {}, {}>;
     image: PgColumn<{
        baseColumn: never;
        columnType: "PgText";
        data: string;
        dataType: "string";
        driverParam: string;
        enumValues: [string, ...string[]];
        hasDefault: false;
        name: "image";
        notNull: false;
        tableName: "user";
     }, {}, {}>;
     name: PgColumn<{
        baseColumn: never;
        columnType: "PgText";
        data: string;
        dataType: "string";
        driverParam: string;
        enumValues: [string, ...string[]];
        hasDefault: false;
        name: "name";
        notNull: false;
        tableName: "user";
     }, {}, {}>;
  };
  dialect: "pg";
  name: "user";
  schema: undefined;
}>;

Type declaration

columns

columns: {
  email: PgColumn<{
     baseColumn: never;
     columnType: "PgText";
     data: string;
     dataType: "string";
     driverParam: string;
     enumValues: [string, ...string[]];
     hasDefault: false;
     name: "email";
     notNull: true;
     tableName: "user";
  }, {}, {}>;
  emailVerified: PgColumn<{
     baseColumn: never;
     columnType: "PgTimestamp";
     data: Date;
     dataType: "date";
     driverParam: string;
     enumValues: undefined;
     hasDefault: false;
     name: "emailVerified";
     notNull: false;
     tableName: "user";
  }, {}, {}>;
  id: PgColumn<{
     baseColumn: never;
     columnType: "PgText";
     data: string;
     dataType: "string";
     driverParam: string;
     enumValues: [string, ...string[]];
     hasDefault: true;
     name: "id";
     notNull: true;
     tableName: "user";
  }, {}, {}>;
  image: PgColumn<{
     baseColumn: never;
     columnType: "PgText";
     data: string;
     dataType: "string";
     driverParam: string;
     enumValues: [string, ...string[]];
     hasDefault: false;
     name: "image";
     notNull: false;
     tableName: "user";
  }, {}, {}>;
  name: PgColumn<{
     baseColumn: never;
     columnType: "PgText";
     data: string;
     dataType: "string";
     driverParam: string;
     enumValues: [string, ...string[]];
     hasDefault: false;
     name: "name";
     notNull: false;
     tableName: "user";
  }, {}, {}>;
};

columns.email

email: PgColumn<{
  baseColumn: never;
  columnType: "PgText";
  data: string;
  dataType: "string";
  driverParam: string;
  enumValues: [string, ...string[]];
  hasDefault: false;
  name: "email";
  notNull: true;
  tableName: "user";
}, {}, {}>;
Type declaration
baseColumn
baseColumn: never;
columnType
columnType: "PgText";
data
data: string;
dataType
dataType: "string";
driverParam
driverParam: string;
enumValues
enumValues: [string, ...string[]];
hasDefault
hasDefault: false;
name
name: "email";
notNull
notNull: true;
tableName
tableName: "user";

columns.emailVerified

emailVerified: PgColumn<{
  baseColumn: never;
  columnType: "PgTimestamp";
  data: Date;
  dataType: "date";
  driverParam: string;
  enumValues: undefined;
  hasDefault: false;
  name: "emailVerified";
  notNull: false;
  tableName: "user";
}, {}, {}>;
Type declaration
baseColumn
baseColumn: never;
columnType
columnType: "PgTimestamp";
data
data: Date;
dataType
dataType: "date";
driverParam
driverParam: string;
enumValues
enumValues: undefined;
hasDefault
hasDefault: false;
name
name: "emailVerified";
notNull
notNull: false;
tableName
tableName: "user";

columns.id

id: PgColumn<{
  baseColumn: never;
  columnType: "PgText";
  data: string;
  dataType: "string";
  driverParam: string;
  enumValues: [string, ...string[]];
  hasDefault: true;
  name: "id";
  notNull: true;
  tableName: "user";
}, {}, {}>;
Type declaration
baseColumn
baseColumn: never;
columnType
columnType: "PgText";
data
data: string;
dataType
dataType: "string";
driverParam
driverParam: string;
enumValues
enumValues: [string, ...string[]];
hasDefault
hasDefault: true;
name
name: "id";
notNull
notNull: true;
tableName
tableName: "user";

columns.image

image: PgColumn<{
  baseColumn: never;
  columnType: "PgText";
  data: string;
  dataType: "string";
  driverParam: string;
  enumValues: [string, ...string[]];
  hasDefault: false;
  name: "image";
  notNull: false;
  tableName: "user";
}, {}, {}>;
Type declaration
baseColumn
baseColumn: never;
columnType
columnType: "PgText";
data
data: string;
dataType
dataType: "string";
driverParam
driverParam: string;
enumValues
enumValues: [string, ...string[]];
hasDefault
hasDefault: false;
name
name: "image";
notNull
notNull: false;
tableName
tableName: "user";

columns.name

name: PgColumn<{
  baseColumn: never;
  columnType: "PgText";
  data: string;
  dataType: "string";
  driverParam: string;
  enumValues: [string, ...string[]];
  hasDefault: false;
  name: "name";
  notNull: false;
  tableName: "user";
}, {}, {}>;
Type declaration
baseColumn
baseColumn: never;
columnType
columnType: "PgText";
data
data: string;
dataType
dataType: "string";
driverParam
driverParam: string;
enumValues
enumValues: [string, ...string[]];
hasDefault
hasDefault: false;
name
name: "name";
notNull
notNull: false;
tableName
tableName: "user";

dialect

dialect: "pg";

name

name: "user";

schema

schema: undefined;

postgresVerificationTokensTable

const postgresVerificationTokensTable: PgTableWithColumns<{
  columns: {
     expires: PgColumn<{
        baseColumn: never;
        columnType: "PgTimestamp";
        data: Date;
        dataType: "date";
        driverParam: string;
        enumValues: undefined;
        hasDefault: false;
        name: "expires";
        notNull: true;
        tableName: "verificationToken";
     }, {}, {}>;
     identifier: PgColumn<{
        baseColumn: never;
        columnType: "PgText";
        data: string;
        dataType: "string";
        driverParam: string;
        enumValues: [string, ...string[]];
        hasDefault: false;
        name: "identifier";
        notNull: true;
        tableName: "verificationToken";
     }, {}, {}>;
     token: PgColumn<{
        baseColumn: never;
        columnType: "PgText";
        data: string;
        dataType: "string";
        driverParam: string;
        enumValues: [string, ...string[]];
        hasDefault: false;
        name: "token";
        notNull: true;
        tableName: "verificationToken";
     }, {}, {}>;
  };
  dialect: "pg";
  name: "verificationToken";
  schema: undefined;
}>;

Type declaration

columns

columns: {
  expires: PgColumn<{
     baseColumn: never;
     columnType: "PgTimestamp";
     data: Date;
     dataType: "date";
     driverParam: string;
     enumValues: undefined;
     hasDefault: false;
     name: "expires";
     notNull: true;
     tableName: "verificationToken";
  }, {}, {}>;
  identifier: PgColumn<{
     baseColumn: never;
     columnType: "PgText";
     data: string;
     dataType: "string";
     driverParam: string;
     enumValues: [string, ...string[]];
     hasDefault: false;
     name: "identifier";
     notNull: true;
     tableName: "verificationToken";
  }, {}, {}>;
  token: PgColumn<{
     baseColumn: never;
     columnType: "PgText";
     data: string;
     dataType: "string";
     driverParam: string;
     enumValues: [string, ...string[]];
     hasDefault: false;
     name: "token";
     notNull: true;
     tableName: "verificationToken";
  }, {}, {}>;
};

columns.expires

expires: PgColumn<{
  baseColumn: never;
  columnType: "PgTimestamp";
  data: Date;
  dataType: "date";
  driverParam: string;
  enumValues: undefined;
  hasDefault: false;
  name: "expires";
  notNull: true;
  tableName: "verificationToken";
}, {}, {}>;
Type declaration
baseColumn
baseColumn: never;
columnType
columnType: "PgTimestamp";
data
data: Date;
dataType
dataType: "date";
driverParam
driverParam: string;
enumValues
enumValues: undefined;
hasDefault
hasDefault: false;
name
name: "expires";
notNull
notNull: true;
tableName
tableName: "verificationToken";

columns.identifier

identifier: PgColumn<{
  baseColumn: never;
  columnType: "PgText";
  data: string;
  dataType: "string";
  driverParam: string;
  enumValues: [string, ...string[]];
  hasDefault: false;
  name: "identifier";
  notNull: true;
  tableName: "verificationToken";
}, {}, {}>;
Type declaration
baseColumn
baseColumn: never;
columnType
columnType: "PgText";
data
data: string;
dataType
dataType: "string";
driverParam
driverParam: string;
enumValues
enumValues: [string, ...string[]];
hasDefault
hasDefault: false;
name
name: "identifier";
notNull
notNull: true;
tableName
tableName: "verificationToken";

columns.token

token: PgColumn<{
  baseColumn: never;
  columnType: "PgText";
  data: string;
  dataType: "string";
  driverParam: string;
  enumValues: [string, ...string[]];
  hasDefault: false;
  name: "token";
  notNull: true;
  tableName: "verificationToken";
}, {}, {}>;
Type declaration
baseColumn
baseColumn: never;
columnType
columnType: "PgText";
data
data: string;
dataType
dataType: "string";
driverParam
driverParam: string;
enumValues
enumValues: [string, ...string[]];
hasDefault
hasDefault: false;
name
name: "token";
notNull
notNull: true;
tableName
tableName: "verificationToken";

dialect

dialect: "pg";

name

name: "verificationToken";

schema

schema: undefined;

PostgresDrizzleAdapter()

PostgresDrizzleAdapter(client, schema): Adapter

Parameters

ParameterType
clientPgDatabase<QueryResultHKT, any, ExtractTablesWithRelations<any>>
schemaDefaultPostgresSchema

Returns

Adapter

Auth.js © Balázs Orbán and Team - 2024