Avoid having protocol-ws build of surrealdb depend on surrealdb-core by nresare · Pull Request #7281 · surrealdb/surrealdb · GitHub
Skip to content

Avoid having protocol-ws build of surrealdb depend on surrealdb-core#7281

Draft
nresare wants to merge 5 commits intosurrealdb:mainfrom
nresare:introduce_surrealdb_client_core
Draft

Avoid having protocol-ws build of surrealdb depend on surrealdb-core#7281
nresare wants to merge 5 commits intosurrealdb:mainfrom
nresare:introduce_surrealdb_client_core

Conversation

@nresare
Copy link
Copy Markdown
Contributor

@nresare nresare commented Apr 20, 2026

Please note that this is more of a proof-of-concept than change that is ready to land as-is. Feel free to re-shape this however you see fit. I mostly wanted to show that it is possible.

What is the motivation?

When building the surrealdb crate with features protocol-ws and/or protocol-http only a tiny piece of surrealdb-core is actually used. This PR moves the needed pieces of surrealdb-core into a new crate surrealdb-client-core and makes surrealdb-core depend on the new crate.

This speeds up analysis and build any rust project that uses the surrealdb sdk to connect to a remote server quite substantially.

What does this change do?

A combination of techniques, some types are moved to the new crate (and imported back into their old locations), some fields and declarations are wrapped with cfg annotations. It seems probable that something went wrong here.

What is your testing strategy?

I have built with some basic variations of --features to trigger the small and the large build. It is not an exhaustive test, I'll see if I can be more structured tomorrow.

Is this related to any issues?

Yes, the overarching problem with slow builds is discussed in #6954

Have you read the Contributing Guidelines?

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