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

lib/sqlite

DefaultSQLiteAccountsTable

type DefaultSQLiteAccountsTable: SQLiteTableWithColumns<{
  columns: {
     access_token: DefaultSQLiteColumn<{
        columnType: "SQLiteText";
        data: string;
        dataType: "string";
        notNull: boolean;
     }>;
     expires_at: DefaultSQLiteColumn<{
        columnType: "SQLiteInteger";
        data: number;
        dataType: "number";
        notNull: boolean;
     }>;
     id_token: DefaultSQLiteColumn<{
        columnType: "SQLiteText";
        data: string;
        dataType: "string";
        notNull: boolean;
     }>;
     provider: DefaultSQLiteColumn<{
        columnType: "SQLiteText";
        data: string;
        dataType: "string";
        notNull: true;
     }>;
     providerAccountId: DefaultSQLiteColumn<{
        columnType: "SQLiteText";
        data: string;
        dataType: "string";
        notNull: true;
     }>;
     refresh_token: DefaultSQLiteColumn<{
        columnType: "SQLiteText";
        data: string;
        dataType: "string";
        notNull: boolean;
     }>;
     scope: DefaultSQLiteColumn<{
        columnType: "SQLiteText";
        data: string;
        dataType: "string";
        notNull: boolean;
     }>;
     session_state: DefaultSQLiteColumn<{
        columnType: "SQLiteText";
        data: string;
        dataType: "string";
        notNull: boolean;
     }>;
     token_type: DefaultSQLiteColumn<{
        columnType: "SQLiteText";
        data: string;
        dataType: "string";
        notNull: boolean;
     }>;
     type: DefaultSQLiteColumn<{
        columnType: "SQLiteText";
        data: string;
        dataType: "string";
        notNull: true;
     }>;
     userId: DefaultSQLiteColumn<{
        columnType: "SQLiteText";
        data: string;
        dataType: "string";
        notNull: true;
     }>;
  };
  dialect: "sqlite";
  name: string;
  schema: string | undefined;
}>;

Type declaration

columns

columns: {
  access_token: DefaultSQLiteColumn<{
     columnType: "SQLiteText";
     data: string;
     dataType: "string";
     notNull: boolean;
  }>;
  expires_at: DefaultSQLiteColumn<{
     columnType: "SQLiteInteger";
     data: number;
     dataType: "number";
     notNull: boolean;
  }>;
  id_token: DefaultSQLiteColumn<{
     columnType: "SQLiteText";
     data: string;
     dataType: "string";
     notNull: boolean;
  }>;
  provider: DefaultSQLiteColumn<{
     columnType: "SQLiteText";
     data: string;
     dataType: "string";
     notNull: true;
  }>;
  providerAccountId: DefaultSQLiteColumn<{
     columnType: "SQLiteText";
     data: string;
     dataType: "string";
     notNull: true;
  }>;
  refresh_token: DefaultSQLiteColumn<{
     columnType: "SQLiteText";
     data: string;
     dataType: "string";
     notNull: boolean;
  }>;
  scope: DefaultSQLiteColumn<{
     columnType: "SQLiteText";
     data: string;
     dataType: "string";
     notNull: boolean;
  }>;
  session_state: DefaultSQLiteColumn<{
     columnType: "SQLiteText";
     data: string;
     dataType: "string";
     notNull: boolean;
  }>;
  token_type: DefaultSQLiteColumn<{
     columnType: "SQLiteText";
     data: string;
     dataType: "string";
     notNull: boolean;
  }>;
  type: DefaultSQLiteColumn<{
     columnType: "SQLiteText";
     data: string;
     dataType: "string";
     notNull: true;
  }>;
  userId: DefaultSQLiteColumn<{
     columnType: "SQLiteText";
     data: string;
     dataType: "string";
     notNull: true;
  }>;
};

columns.access_token

access_token: DefaultSQLiteColumn<{
  columnType: "SQLiteText";
  data: string;
  dataType: "string";
  notNull: boolean;
}>;
Type declaration
columnType
columnType: "SQLiteText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: boolean;

columns.expires_at

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

columns.id_token

id_token: DefaultSQLiteColumn<{
  columnType: "SQLiteText";
  data: string;
  dataType: "string";
  notNull: boolean;
}>;
Type declaration
columnType
columnType: "SQLiteText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: boolean;

columns.provider

provider: DefaultSQLiteColumn<{
  columnType: "SQLiteText";
  data: string;
  dataType: "string";
  notNull: true;
}>;
Type declaration
columnType
columnType: "SQLiteText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: true;

columns.providerAccountId

providerAccountId: DefaultSQLiteColumn<{
  columnType: "SQLiteText";
  data: string;
  dataType: "string";
  notNull: true;
}>;
Type declaration
columnType
columnType: "SQLiteText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: true;

columns.refresh_token

refresh_token: DefaultSQLiteColumn<{
  columnType: "SQLiteText";
  data: string;
  dataType: "string";
  notNull: boolean;
}>;
Type declaration
columnType
columnType: "SQLiteText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: boolean;

columns.scope

scope: DefaultSQLiteColumn<{
  columnType: "SQLiteText";
  data: string;
  dataType: "string";
  notNull: boolean;
}>;
Type declaration
columnType
columnType: "SQLiteText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: boolean;

columns.session_state

session_state: DefaultSQLiteColumn<{
  columnType: "SQLiteText";
  data: string;
  dataType: "string";
  notNull: boolean;
}>;
Type declaration
columnType
columnType: "SQLiteText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: boolean;

columns.token_type

token_type: DefaultSQLiteColumn<{
  columnType: "SQLiteText";
  data: string;
  dataType: "string";
  notNull: boolean;
}>;
Type declaration
columnType
columnType: "SQLiteText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: boolean;

columns.type

type: DefaultSQLiteColumn<{
  columnType: "SQLiteText";
  data: string;
  dataType: "string";
  notNull: true;
}>;
Type declaration
columnType
columnType: "SQLiteText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: true;

columns.userId

userId: DefaultSQLiteColumn<{
  columnType: "SQLiteText";
  data: string;
  dataType: "string";
  notNull: true;
}>;
Type declaration
columnType
columnType: "SQLiteText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: true;

dialect

dialect: "sqlite";

name

name: string;

schema

schema: string | undefined;

DefaultSQLiteAuthenticatorTable

type DefaultSQLiteAuthenticatorTable: SQLiteTableWithColumns<{
  columns: {
     counter: DefaultSQLiteColumn<{
        columnType: "SQLiteInteger";
        data: number;
        dataType: "number";
        notNull: true;
     }>;
     credentialBackedUp: DefaultSQLiteColumn<{
        columnType: "SQLiteBoolean";
        data: boolean;
        dataType: "boolean";
        notNull: true;
     }>;
     credentialDeviceType: DefaultSQLiteColumn<{
        columnType: "SQLiteText";
        data: string;
        dataType: "string";
        notNull: true;
     }>;
     credentialID: DefaultSQLiteColumn<{
        columnType: "SQLiteText";
        data: string;
        dataType: "string";
        notNull: true;
     }>;
     credentialPublicKey: DefaultSQLiteColumn<{
        columnType: "SQLiteText";
        data: string;
        dataType: "string";
        notNull: true;
     }>;
     providerAccountId: DefaultSQLiteColumn<{
        columnType: "SQLiteText";
        data: string;
        dataType: "string";
        notNull: true;
     }>;
     transports: DefaultSQLiteColumn<{
        columnType: "SQLiteText";
        data: string;
        dataType: "string";
        notNull: false;
     }>;
     userId: DefaultSQLiteColumn<{
        columnType: "SQLiteText";
        data: string;
        dataType: "string";
        notNull: true;
     }>;
  };
  dialect: "sqlite";
  name: string;
  schema: string | undefined;
}>;

Type declaration

columns

columns: {
  counter: DefaultSQLiteColumn<{
     columnType: "SQLiteInteger";
     data: number;
     dataType: "number";
     notNull: true;
  }>;
  credentialBackedUp: DefaultSQLiteColumn<{
     columnType: "SQLiteBoolean";
     data: boolean;
     dataType: "boolean";
     notNull: true;
  }>;
  credentialDeviceType: DefaultSQLiteColumn<{
     columnType: "SQLiteText";
     data: string;
     dataType: "string";
     notNull: true;
  }>;
  credentialID: DefaultSQLiteColumn<{
     columnType: "SQLiteText";
     data: string;
     dataType: "string";
     notNull: true;
  }>;
  credentialPublicKey: DefaultSQLiteColumn<{
     columnType: "SQLiteText";
     data: string;
     dataType: "string";
     notNull: true;
  }>;
  providerAccountId: DefaultSQLiteColumn<{
     columnType: "SQLiteText";
     data: string;
     dataType: "string";
     notNull: true;
  }>;
  transports: DefaultSQLiteColumn<{
     columnType: "SQLiteText";
     data: string;
     dataType: "string";
     notNull: false;
  }>;
  userId: DefaultSQLiteColumn<{
     columnType: "SQLiteText";
     data: string;
     dataType: "string";
     notNull: true;
  }>;
};

columns.counter

counter: DefaultSQLiteColumn<{
  columnType: "SQLiteInteger";
  data: number;
  dataType: "number";
  notNull: true;
}>;
Type declaration
columnType
columnType: "SQLiteInteger";
data
data: number;
dataType
dataType: "number";
notNull
notNull: true;

columns.credentialBackedUp

credentialBackedUp: DefaultSQLiteColumn<{
  columnType: "SQLiteBoolean";
  data: boolean;
  dataType: "boolean";
  notNull: true;
}>;
Type declaration
columnType
columnType: "SQLiteBoolean";
data
data: boolean;
dataType
dataType: "boolean";
notNull
notNull: true;

columns.credentialDeviceType

credentialDeviceType: DefaultSQLiteColumn<{
  columnType: "SQLiteText";
  data: string;
  dataType: "string";
  notNull: true;
}>;
Type declaration
columnType
columnType: "SQLiteText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: true;

columns.credentialID

credentialID: DefaultSQLiteColumn<{
  columnType: "SQLiteText";
  data: string;
  dataType: "string";
  notNull: true;
}>;
Type declaration
columnType
columnType: "SQLiteText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: true;

columns.credentialPublicKey

credentialPublicKey: DefaultSQLiteColumn<{
  columnType: "SQLiteText";
  data: string;
  dataType: "string";
  notNull: true;
}>;
Type declaration
columnType
columnType: "SQLiteText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: true;

columns.providerAccountId

providerAccountId: DefaultSQLiteColumn<{
  columnType: "SQLiteText";
  data: string;
  dataType: "string";
  notNull: true;
}>;
Type declaration
columnType
columnType: "SQLiteText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: true;

columns.transports

transports: DefaultSQLiteColumn<{
  columnType: "SQLiteText";
  data: string;
  dataType: "string";
  notNull: false;
}>;
Type declaration
columnType
columnType: "SQLiteText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: false;

columns.userId

userId: DefaultSQLiteColumn<{
  columnType: "SQLiteText";
  data: string;
  dataType: "string";
  notNull: true;
}>;
Type declaration
columnType
columnType: "SQLiteText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: true;

dialect

dialect: "sqlite";

name

name: string;

schema

schema: string | undefined;

DefaultSQLiteSchema

type DefaultSQLiteSchema: {
  accountsTable: DefaultSQLiteAccountsTable;
  authenticatorsTable: DefaultSQLiteAuthenticatorTable;
  sessionsTable: DefaultSQLiteSessionsTable;
  usersTable: DefaultSQLiteUsersTable;
  verificationTokensTable: DefaultSQLiteVerificationTokenTable;
};

Type declaration

accountsTable

accountsTable: DefaultSQLiteAccountsTable;

authenticatorsTable?

optional authenticatorsTable: DefaultSQLiteAuthenticatorTable;

sessionsTable?

optional sessionsTable: DefaultSQLiteSessionsTable;

usersTable

usersTable: DefaultSQLiteUsersTable;

verificationTokensTable?

optional verificationTokensTable: DefaultSQLiteVerificationTokenTable;

DefaultSQLiteSessionsTable

type DefaultSQLiteSessionsTable: SQLiteTableWithColumns<{
  columns: {
     expires: DefaultSQLiteColumn<{
        columnType: "SQLiteTimestamp";
        data: Date;
        dataType: "date";
        notNull: true;
     }>;
     sessionToken: DefaultSQLiteColumn<{
        columnType: "SQLiteText";
        data: string;
        dataType: "string";
        notNull: true;
     }>;
     userId: DefaultSQLiteColumn<{
        columnType: "SQLiteText";
        data: string;
        dataType: "string";
        notNull: true;
     }>;
  };
  dialect: "sqlite";
  name: string;
  schema: string | undefined;
}>;

Type declaration

columns

columns: {
  expires: DefaultSQLiteColumn<{
     columnType: "SQLiteTimestamp";
     data: Date;
     dataType: "date";
     notNull: true;
  }>;
  sessionToken: DefaultSQLiteColumn<{
     columnType: "SQLiteText";
     data: string;
     dataType: "string";
     notNull: true;
  }>;
  userId: DefaultSQLiteColumn<{
     columnType: "SQLiteText";
     data: string;
     dataType: "string";
     notNull: true;
  }>;
};

columns.expires

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

columns.sessionToken

sessionToken: DefaultSQLiteColumn<{
  columnType: "SQLiteText";
  data: string;
  dataType: "string";
  notNull: true;
}>;
Type declaration
columnType
columnType: "SQLiteText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: true;

columns.userId

userId: DefaultSQLiteColumn<{
  columnType: "SQLiteText";
  data: string;
  dataType: "string";
  notNull: true;
}>;
Type declaration
columnType
columnType: "SQLiteText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: true;

dialect

dialect: "sqlite";

name

name: string;

schema

schema: string | undefined;

DefaultSQLiteUsersTable

type DefaultSQLiteUsersTable: SQLiteTableWithColumns<{
  columns: {
     email: DefaultSQLiteColumn<{
        columnType: "SQLiteText";
        data: string;
        dataType: "string";
        notNull: true;
     }>;
     emailVerified: DefaultSQLiteColumn<{
        columnType: "SQLiteTimestamp";
        data: Date;
        dataType: "date";
        notNull: boolean;
     }>;
     id: DefaultSQLiteColumn<{
        columnType: "SQLiteText";
        data: string;
        dataType: "string";
        notNull: true;
     }>;
     image: DefaultSQLiteColumn<{
        columnType: "SQLiteText";
        data: string;
        dataType: "string";
        notNull: boolean;
     }>;
     name: DefaultSQLiteColumn<{
        columnType: "SQLiteText";
        data: string;
        dataType: "string";
        notNull: boolean;
     }>;
  };
  dialect: "sqlite";
  name: string;
  schema: string | undefined;
}>;

Type declaration

columns

columns: {
  email: DefaultSQLiteColumn<{
     columnType: "SQLiteText";
     data: string;
     dataType: "string";
     notNull: true;
  }>;
  emailVerified: DefaultSQLiteColumn<{
     columnType: "SQLiteTimestamp";
     data: Date;
     dataType: "date";
     notNull: boolean;
  }>;
  id: DefaultSQLiteColumn<{
     columnType: "SQLiteText";
     data: string;
     dataType: "string";
     notNull: true;
  }>;
  image: DefaultSQLiteColumn<{
     columnType: "SQLiteText";
     data: string;
     dataType: "string";
     notNull: boolean;
  }>;
  name: DefaultSQLiteColumn<{
     columnType: "SQLiteText";
     data: string;
     dataType: "string";
     notNull: boolean;
  }>;
};

columns.email

email: DefaultSQLiteColumn<{
  columnType: "SQLiteText";
  data: string;
  dataType: "string";
  notNull: true;
}>;
Type declaration
columnType
columnType: "SQLiteText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: true;

columns.emailVerified

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

columns.id

id: DefaultSQLiteColumn<{
  columnType: "SQLiteText";
  data: string;
  dataType: "string";
  notNull: true;
}>;
Type declaration
columnType
columnType: "SQLiteText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: true;

columns.image

image: DefaultSQLiteColumn<{
  columnType: "SQLiteText";
  data: string;
  dataType: "string";
  notNull: boolean;
}>;
Type declaration
columnType
columnType: "SQLiteText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: boolean;

columns.name

name: DefaultSQLiteColumn<{
  columnType: "SQLiteText";
  data: string;
  dataType: "string";
  notNull: boolean;
}>;
Type declaration
columnType
columnType: "SQLiteText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: boolean;

dialect

dialect: "sqlite";

name

name: string;

schema

schema: string | undefined;

DefaultSQLiteVerificationTokenTable

type DefaultSQLiteVerificationTokenTable: SQLiteTableWithColumns<{
  columns: {
     expires: DefaultSQLiteColumn<{
        columnType: "SQLiteTimestamp";
        data: Date;
        dataType: "date";
        notNull: true;
     }>;
     identifier: DefaultSQLiteColumn<{
        columnType: "SQLiteText";
        data: string;
        dataType: "string";
        notNull: true;
     }>;
     token: DefaultSQLiteColumn<{
        columnType: "SQLiteText";
        data: string;
        dataType: "string";
        notNull: true;
     }>;
  };
  dialect: "sqlite";
  name: string;
  schema: string | undefined;
}>;

Type declaration

columns

columns: {
  expires: DefaultSQLiteColumn<{
     columnType: "SQLiteTimestamp";
     data: Date;
     dataType: "date";
     notNull: true;
  }>;
  identifier: DefaultSQLiteColumn<{
     columnType: "SQLiteText";
     data: string;
     dataType: "string";
     notNull: true;
  }>;
  token: DefaultSQLiteColumn<{
     columnType: "SQLiteText";
     data: string;
     dataType: "string";
     notNull: true;
  }>;
};

columns.expires

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

columns.identifier

identifier: DefaultSQLiteColumn<{
  columnType: "SQLiteText";
  data: string;
  dataType: "string";
  notNull: true;
}>;
Type declaration
columnType
columnType: "SQLiteText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: true;

columns.token

token: DefaultSQLiteColumn<{
  columnType: "SQLiteText";
  data: string;
  dataType: "string";
  notNull: true;
}>;
Type declaration
columnType
columnType: "SQLiteText";
data
data: string;
dataType
dataType: "string";
notNull
notNull: true;

dialect

dialect: "sqlite";

name

name: string;

schema

schema: string | undefined;

SQLiteDrizzleAdapter()

SQLiteDrizzleAdapter(client, schema?): Adapter

Parameters

ParameterType
clientBaseSQLiteDatabase<"sync" | "async", any, any, ExtractTablesWithRelations<any>>
schema?DefaultSQLiteSchema

Returns

Adapter


defineTables()

defineTables(schema): Required<DefaultSQLiteSchema>

Parameters

ParameterType
schemaPartial<DefaultSQLiteSchema>

Returns

Required<DefaultSQLiteSchema>

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