Skip to content

Add support for specifying (named) Firestore database ID#147

Open
ochoalopezalfredo wants to merge 1 commit intokossnocorp:mainfrom
IberCore:main
Open

Add support for specifying (named) Firestore database ID#147
ochoalopezalfredo wants to merge 1 commit intokossnocorp:mainfrom
IberCore:main

Conversation

@ochoalopezalfredo
Copy link

@ochoalopezalfredo ochoalopezalfredo commented Nov 28, 2025

This PR adds the ability to specify the Firestore database ID when initializing Typesaurus. This is useful for projects using multiple databases within a single Firebase project or when connecting to a non-default database.

Changes:

Updated TypesaurusCore.Options interface in src/types/core.ts to include the optional database property.

Updated Firestore initialization in admin src/adapter/admin/firebase.mjs and web src/adapter/web/firebase.mjs adapters to pass the database Id to the getFirestore function.

Bumped package version to 10.7.1 in package.json

Updated CHANGELOG.md file

Usage Example:

import { schema } from 'typesaurus'

const db = schema(
  ($) => ({
    users: $.collection<User>()
  }),
  { database: 'my-custom-db-id' }
)

@kossnocorp #130 issue

…etFirestore` in Firebase adapters, to allow connections to named databases.
@ochoalopezalfredo ochoalopezalfredo marked this pull request as ready for review November 28, 2025 17:03
@ochoalopezalfredo ochoalopezalfredo marked this pull request as draft November 28, 2025 17:04
@ochoalopezalfredo ochoalopezalfredo marked this pull request as ready for review November 28, 2025 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant