Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions firestore-bigquery-export/guides/GENERATE_SCHEMA_VIEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ The `fs-bq-schema-views` script creates richly-typed BigQuery views from your ra
- Preserves all raw data (no data loss due to schema mismatches)
- Supports complex Firestore data types like arrays, maps, and geopoints

### AI-powered schema generation with Genkit

This extension uses the [Genkit SDK](https://genkit.dev/) to power AI-based schema generation for Firestore data.

For more information about Genkit, visit the Genkit documentation at [genkit.dev](http://genkit.dev/).

## Prerequisites

1. Node.js installed (to run npm and npx commands)
Expand Down
1,657 changes: 895 additions & 762 deletions firestore-bigquery-export/scripts/gen-schema-view/package-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"scripts": {
"build": "npm run clean && npm run compile",
"clean": "rimraf ./lib",
"compile": "tsc && cp -r src/__tests__/fixtures lib/__tests__",
"compile": "tsc && copyfiles \"src/__tests__/fixtures/**/*\" lib/__tests__",
"gen-schema-views": "node ./lib/index.js",
"prepare": "npm run build",
"test": "jest"
Expand All @@ -32,14 +32,14 @@
"license": "Apache-2.0",
"dependencies": {
"@firebaseextensions/firestore-bigquery-change-tracker": "^1.1.40",
"@genkit-ai/googleai": "^1.1.0",
"@genkit-ai/googleai": "^1.14.1",
"@google-cloud/bigquery": "^6.0.3",
"commander": "5.0.0",
"firebase-admin": "^12.1.0",
"firebase-functions": "^4.2.0",
"fs-find": "^0.4.0",
"generate-schema": "^2.6.0",
"genkit": "^1.1.0",
"genkit": "^1.14.1",
"glob": "7.1.5",
"inquirer": "^6.4.0",
"sql-formatter": "^2.3.3"
Expand All @@ -51,6 +51,7 @@
"@types/inquirer": "^9.0.7",
"@types/jest": "29.5.0",
"chai": "^4.2.0",
"copyfiles": "^2.4.1",
"exec": "^0.2.1",
"jest": "29.5.0",
"mocked-env": "^1.3.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jest.mock("../../schema/genkit", () => {
};
});

describe.skip("sampleFirestoreDocuments", () => {
describe("sampleFirestoreDocuments", () => {
it("should sample documents from Firestore collection", async () => {
const collectionPath = "test-collection";
const sampleSize = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import type { CliConfig } from "../config";
import firebase = require("firebase-admin");
import { genkit, z } from "genkit";
import { googleAI, gemini20Flash } from "@genkit-ai/googleai";
import { googleAI } from "@genkit-ai/googleai";
import * as fs from "fs";
import * as path from "path";
import inquirer from "inquirer";
Expand Down Expand Up @@ -226,7 +226,7 @@ export const generateSchemaFilesWithGemini = async (config: CliConfig) => {

// prompt gemini with sample data to generate a schema file
const { text } = await ai.generate({
model: gemini20Flash,
model: googleAI.model("gemini-2.5-flash"),
prompt,
output: {
format: "json",
Expand Down
Loading
Loading