Skip to content

basalt / auth-sqlite/src / SqliteUserSource

Class: SqliteUserSource ​

Defined in: auth-sqlite/src/index.ts:214

Implements ​

Constructors ​

Constructor ​

> new SqliteUserSource(db, options?): SqliteUserSource

Defined in: auth-sqlite/src/index.ts:217

Parameters ​

db ​

DatabaseSync

options? ​

SqliteUserSourceOptions = {}

Returns ​

SqliteUserSource

Methods ​

create() ​

> create(data): Promise<AuthUser>

Defined in: auth-sqlite/src/index.ts:269

Parameters ​

data ​
email ​

string

passwordHash ​

string

Returns ​

Promise<AuthUser>

Implementation of ​

UserSource.create


findByEmail() ​

> findByEmail(email): Promise<AuthUser | null>

Defined in: auth-sqlite/src/index.ts:229

Case-insensitive, and refuses ambiguity: a legacy database holding two rows that differ only in case throws AccountEmailAmbiguousError rather than resolving to whichever was inserted first.

Parameters ​

email ​

string

Returns ​

Promise<AuthUser | null>

Implementation of ​

UserSource.findByEmail


findById() ​

> findById(id): Promise<AuthUser | null>

Defined in: auth-sqlite/src/index.ts:238

Parameters ​

id ​

string

Returns ​

Promise<AuthUser | null>

Implementation of ​

UserSource.findById


findByIds() ​

> findByIds(ids): Promise<PublicUser[]>

Defined in: auth-sqlite/src/index.ts:250

One WHERE id IN (…) per chunk instead of one statement per id. Only the non-credential columns are selected, so the password hash is never read; ids with no row are absent from the result, which keeps the caller's order.

Parameters ​

ids ​

readonly string[]

Returns ​

Promise<PublicUser[]>

Implementation of ​

UserSource.findByIds


update() ​

> update(id, patch): Promise<AuthUser | null>

Defined in: auth-sqlite/src/index.ts:287

Required for email verification and password reset. Returns the updated user.

Parameters ​

id ​

string

patch ​

UserPatch

Returns ​

Promise<AuthUser | null>

Implementation of ​

UserSource.update

Released under the MIT License.