MaveriX89
MaveriX89
Explore posts from servers
BABetter Auth
Created by Laktos on 12/26/2024 in #help
Multiple roles for users in organizations
@Laktos were you able to figure this out? I too have the same intent of making a multi-tenant app and need to support users having multiple roles for RBAC/ABAC features
10 replies
DTDrizzle Team
Created by Montgomery Burns on 12/4/2024 in #help
Guidance on Creating a Multi-Tenant Application with PostgreSQL Schemas
Yeah, I'm hoping that combination will provide the solution that people are looking for in this matter: https://www.thenile.dev/blog/better-auth-nile
9 replies
DTDrizzle Team
Created by Montgomery Burns on 12/4/2024 in #help
Guidance on Creating a Multi-Tenant Application with PostgreSQL Schemas
I also came across Citus but I don't think Drizzle supports it
9 replies
DTDrizzle Team
Created by Montgomery Burns on 12/4/2024 in #help
Guidance on Creating a Multi-Tenant Application with PostgreSQL Schemas
I was doing some research earlier today and stumbled upon Nile Postgres. I actually use Better Auth with Drizzle and there is a Nile plugin for Better Auth that adds a lot of this multi-tenant capabilities.
9 replies
DTDrizzle Team
Created by Montgomery Burns on 12/4/2024 in #help
Guidance on Creating a Multi-Tenant Application with PostgreSQL Schemas
Hi @Montgomery Burns , have you made any progress on this effort? I'm about to go down the same journey and curious as to what you found / did thus far?
9 replies
DTDrizzle Team
Created by MaveriX89 on 2/16/2025 in #help
Recommended Docker Compose Workflow
Feel free to correct my thinking if I perhaps suggested anything unhealthy above. I can use all the guidance I can get. I was just thinking that when it comes to "productionizing" my application, I would want to automate as much of the pipeline as possible. And if I could somehow make the step of "Push my Drizzle tables to the database" as part of the "Spin up docker database" process, that would leave me in a better position.
2 replies
BABetter Auth
Created by MaveriX89 on 1/21/2025 in #help
Better Auth + Solid Start
@JaspaJones I wish I could say I did -- I ended up pivoting to a normal SolidJS SPA + Elysia backend setup. I was fighting Solid Start with things related to authenticated states and protected routes. I may revisit it down the line when I have more time. I feel the Better Auth documentation wasn't exactly clear what to do next post setting up this config here for Solid Start:
// routes/api/*auth.ts
import { auth } from "~/lib/auth";
import { toSolidStartHandler } from "better-auth/solid-start";

export const { GET, POST } = toSolidStartHandler(auth);
// routes/api/*auth.ts
import { auth } from "~/lib/auth";
import { toSolidStartHandler } from "better-auth/solid-start";

export const { GET, POST } = toSolidStartHandler(auth);
I don't know if there is supposed to be some magic that happens, but my suspicion is that we lean on the Better Auth server client if you're relying on server actions from Solid Start. So like you saw me post above, I think the interaction pattern would be:
export const logIn = action((formData: FormData) => {
"use server"
const username = String(formData.get("username"));
const password = String(formData.get("password"));

let error = validateUsername(username) || validatePassword(password);

if (error) {
return new Error(error);
}

try {
// Better Auth Server client
const response = await auth.api.signInUsername({ body: { username, password } });
// other stuff..
} catch (err) {
return err as Error;
}

throw redirect("/");
}, "logIn");
export const logIn = action((formData: FormData) => {
"use server"
const username = String(formData.get("username"));
const password = String(formData.get("password"));

let error = validateUsername(username) || validatePassword(password);

if (error) {
return new Error(error);
}

try {
// Better Auth Server client
const response = await auth.api.signInUsername({ body: { username, password } });
// other stuff..
} catch (err) {
return err as Error;
}

throw redirect("/");
}, "logIn");
Unless of course you're doing something client side, then you would lean on the Better Auth web client instead. I think it would be good if we, as a community, could build some crowd-sourced documentation on Better Auth patterns with Solid Start.
3 replies
SSolidJS
Created by MaveriX89 on 1/21/2025 in #support
TanStack Query vs Solid Router
I suppose the equivalent would be along the lines if createAsync (which consumes a query) would have some configuration option built-in to refetch the query on some interval
17 replies
SSolidJS
Created by MaveriX89 on 1/21/2025 in #support
TanStack Query vs Solid Router
Hmm, I'm not sure if I would characterize it that way. I think it's more about the granular control of configuring a query to be a "polling query" at the call-site or point of invocation which is what Solid Query provides.
17 replies
SSolidJS
Created by MaveriX89 on 1/21/2025 in #support
TanStack Query vs Solid Router
It has some really nice refetch helpers in general:
refetchInterval,
refetchIntervalInBackground,
refetchOnMount,
refetchOnReconnect,
refetchOnWindowFocus,
refetchInterval,
refetchIntervalInBackground,
refetchOnMount,
refetchOnReconnect,
refetchOnWindowFocus,
17 replies
SSolidJS
Created by MaveriX89 on 1/21/2025 in #support
TanStack Query vs Solid Router
Yeah, that's correct. You only have to specify a refetchInterval
17 replies
SSolidJS
Created by MaveriX89 on 1/21/2025 in #support
TanStack Query vs Solid Router
Yeah, this is basically a pseudo-realtime use case. Instead of the extreme case (using Websockets), just poll for data every 5 seconds.
17 replies
SSolidJS
Created by MaveriX89 on 1/21/2025 in #support
TanStack Query vs Solid Router
Aside from that detail, am I on the right mental track in what the polling/refetch pattern is supposed to be there when using query + createAsync ? Just revalidate on an interval?
17 replies
SSolidJS
Created by MaveriX89 on 1/21/2025 in #support
TanStack Query vs Solid Router
I've been conditioned to put intervals and their cleanup in effect blocks by default
17 replies
SSolidJS
Created by MaveriX89 on 1/21/2025 in #support
TanStack Query vs Solid Router
That was the React dev in me speaking :Laughing_Facepalm:
17 replies
SSolidJS
Created by MaveriX89 on 1/21/2025 in #support
TanStack Query vs Solid Router
@peerreynders appreciate the link to your write up! Question for you, what does polling look like with Solid Router query ? Like if I'm pairing a query with createAsync, at what level do I apply the setInterval to poll and refetch the data (or I suppose in this case, revalidate the query cache key)? Maybe I just answered my own question there? Haha! As in, do I invoke revalidate within some setInterval that lives in a createEffect?
17 replies
SSolidJS
Created by MaveriX89 on 1/22/2025 in #support
Exception thrown when invoking useNavigate within Router root layout
This is my first time trying to use SolidJS for an app I hope to productionize so all of our dialogue and your input like this has been incredibly helpful! Can't thank you enough for your time and patience @peerreynders :appwriteheart:
33 replies
SSolidJS
Created by MaveriX89 on 1/22/2025 in #support
Exception thrown when invoking useNavigate within Router root layout
I think I can be fine with that. Basically if someone is not logged in and trying to manually navigate anywhere else, I want that to take them back to login. But excellent observation there. I did not realize that until you brought it up 😃
33 replies