Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(zero-pg): implement makeSchemaQuery to run queries on the server #3818

Open
wants to merge 1 commit into
base: mlaw/async-run
Choose a base branch
from

Conversation

tantaman
Copy link
Contributor

No description provided.

@tantaman tantaman requested review from arv and darkgnotic February 14, 2025 21:19
Copy link

vercel bot commented Feb 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
replicache-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 14, 2025 9:21pm
zbugs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 14, 2025 9:21pm

queryProvider = makeSchemaQuery(schema);
});

test('select', async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is just to test the plumbing. Tests of query forms (related/where/exists/etc.) are in z2s/test/chinook

Copy link

🐰 Bencher Report

Branchmlaw/zero-pg5
Testbedlocalhost
Click to view all benchmark results
BenchmarkFile SizeBenchmark Result
kilobytes (KB)
(Result Δ%)
Upper Boundary
kilobytes (KB)
(Limit %)
zero-package.tgz📈 view plot
🚷 view threshold
961.26
(0.00%)Baseline: 961.26
980.49
(98.04%)
zero.js📈 view plot
🚷 view threshold
180.39
(0.00%)Baseline: 180.39
184.00
(98.04%)
zero.js.br📈 view plot
🚷 view threshold
50.10
(0.00%)Baseline: 50.10
51.11
(98.04%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

@arv arv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Same concern here with Proxy.

}

async run(): Promise<HumanReadable<TReturn>> {
const sqlQuery = formatPg(compile(this._completeAst(), this.format));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we cache this so we do not have to recompute it?

Comment on lines +82 to +85
if (Array.isArray(result)) {
return result as HumanReadable<TReturn>;
}
return [...result] as HumanReadable<TReturn>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct? How does this fit with one()?

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.

2 participants