Skip to content

[draft] fix: allow use as library dependency without git submodules#242

Closed
zyrakq wants to merge 2 commits into
trailbaseio:mainfrom
zyrakq:hotfix/subtree-deps
Closed

[draft] fix: allow use as library dependency without git submodules#242
zyrakq wants to merge 2 commits into
trailbaseio:mainfrom
zyrakq:hotfix/subtree-deps

Conversation

@zyrakq

@zyrakq zyrakq commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Problem

When TrailBase is consumed as a library from an external workspace (e.g. via git subtree), the build fails because:

  1. sqlite-vec and pgrow2serde are path dependencies pointing to unpopulated git submodules.
  2. serde_rusqlite uses rusqlite = { workspace = true }, which requires TrailBase to be the active workspace root — this breaks when resolved from outside.

Solution

Replace the three sub-dependencies with sources that work standalone, while keeping [patch] entries so local submodule paths are still used when building TrailBase directly.

Since [patch] is only applied from the root workspace, contributors with submodules populated see no change in behavior.

zyrakq added 2 commits June 10, 2026 15:33
Replaced ignatz/serde_rusqlite git dependency with
crates.io v0.43.0
Reverted sqlite-vec and pgrow2serde to branch refs
instead of pinned commits

Allow consuming trailbase as a path dep from external
workspaces without workspace context
The ignatz fork uses workspace = true for rusqlite which
makes it unusable as a standalone dependency; crates.io
0.43.0 provides explicit rusqlite ^0.40 and works
standalone
@zyrakq zyrakq force-pushed the hotfix/subtree-deps branch from ba288ae to ce84cee Compare June 10, 2026 15:58
@zyrakq zyrakq changed the title fix: allow use as library dependency without git submodules [draft] fix: allow use as library dependency without git submodules Jun 11, 2026
Comment thread Cargo.toml
serde_qs = { version = "1.0.0", default-features = false, features = [] }
serde_rusqlite = { path = "vendor/serde_rusqlite" }
sqlite-vec = { path = "vendor/sqlite-vec/bindings/rust", default-features = false }
serde_rusqlite = "0.43.0"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(No action required)

serde_rusqlite is a well-maintained crate. I merely vendored it in the past since sometimes it would take a few weeks before rusqlite updates propagate. On the flip-side my vendored version has become stale, so thank you for pointing it back at upstream.

@ignatz

ignatz commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

This looks great, thanks! Will squash as soon as the workflows pass.

Out of curiosity, I suspect you're using TB as a library - is that right? For context, with APIs internally changing quite a bit (e.g. lately DB init sync -> async to accommodate for PG) this is something I haven't payed too much attention to. Appreciate you not being discouraged by these obstacles. Please keep it coming 🙏

@zyrakq

zyrakq commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

I was a bit hasty in opening the PR and specified some inappropriate versions of the packages. The test will likely fail, but even if it does, something might break. Unfortunately, I'm having some issues with the network and development environment, so I won't be able to fix it until tomorrow.

@zyrakq zyrakq marked this pull request as draft June 12, 2026 08:29
@ignatz

ignatz commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

I was a bit hasty in opening the PR and specified some inappropriate versions of the packages. The test will likely fail, but even if it does, something might break. Unfortunately, I'm having some issues with the network and development environment, so I won't be able to fix it until tomorrow.

I suspect it's only an issue for you (i.e. I expect tests and workspace builds to pass), specifically vendor/sqlite-vec should be pointed at the v0.1.10-alpha.4-fork branch. Happy to fix up.

@ignatz

ignatz commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Just pushed it to the dev branch: e91c17e 🙏

Will rebase a few more minor changes and release a new version to get the OTP fix out ASAP. Thanks again

@ignatz ignatz closed this Jun 12, 2026
@zyrakq

zyrakq commented Jun 13, 2026

Copy link
Copy Markdown
Contributor Author

Yes, I'm using TB as a library 👍
I haven't run into any issues so far, except for my own mistakes with package versions.

I actually got started with Trailbase as a BaaS, so I'm not very up to speed on the internal challenges you're dealing with (like the recent DB init sync → async changes). Thanks for the context.

I skimmed through some of the open issues — a few of the features discussed there are things I’d also like to see. Might try to propose something in the future around making the admin panel more extensible (for example, via web components and micro-frontends).

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