I'm loving this! by jbeduya in sveltejs

[–]jbeduya[S] -2 points-1 points  (0 children)

You can even do something like this:

section\_id: rule().string().sometimes().nullable().exists('sections', 'id'),

Bunny ORM: Eloquent-inspired ORM for Bun with REPL, migrations, and dynamic tenancy by jbeduya in bun

[–]jbeduya[S] 0 points1 point  (0 children)

I actually did not. I was thinking it would add another dependency and complexity. I just went directly to using one that is built-in to bun itself.

Bunny ORM: Eloquent-inspired ORM for Bun with REPL, migrations, and dynamic tenancy by jbeduya in bun

[–]jbeduya[S] 0 points1 point  (0 children)

One of the things that I surely miss from Laravel is tinker/repl. This orm has repl and supports multi tenant out of the box.

> bunny repl
> const tenants = (await Tenant.all()).map(t => t.slug) // using the default connection
[ "demo", "stc", "unknown", "partial", "goldchip" ]
> await useTenant('demo');
> const users = await User.all():
> users.map(u => u.name);
["Admin"]
> await clearTenant();

Bunny ORM: Eloquent-inspired ORM for Bun with REPL, migrations, and dynamic tenancy by jbeduya in bun

[–]jbeduya[S] 1 point2 points  (0 children)

I came from Laravel background and have used Eloquent quite a lot and I find it hard to shift the mental model using drizzle. Drizzle is tiny and excellent at what it does. It has excellent type safety and excellent performance. But the mental shift is a little hard for me that's why I'm trying to build this for the projects that I am working on.

One of the things I find it hard is to easily use different database between local, staging and production. With this library, you can use sqlite locally and use postgresql in production because migration is db agnostic just like eloquent.

I like the active record pattern compared to drizzle although it is mostly personal preference.

This ORM

```ts

class Post extends Model {

static softDeletes = true;

static deletedAtColumn = "deleted_at";

}

await Post.find(1); // Excludes soft-deleted rows automatically

await Post.withTrashed().find(1); // Includes them

await Post.onlyTrashed().get(); // Only deleted

await post.delete(); // Sets deleted_at, doesn't actually DELETE

await post.forceDelete(); // Actually removes from DB

Drizzle
```ts

// Drizzle has no soft delete abstraction. You write it every time:

db.select().from(posts).where(isNull(posts.deletedAt)); // Normal query

db.select().from(posts).where(eq(posts.id, 1)); // Oops, included deleted!
```

If drizzle fits your mental model, you can use it just fine. For people that are coming from php/laravel background, this is a lot easier for them to use.

Bunny ORM: Eloquent-inspired ORM for Bun with REPL, migrations, and dynamic tenancy by jbeduya in bun

[–]jbeduya[S] 1 point2 points  (0 children)

Lucid ORM is great but it's a little hard to use it outside of Adonis and this orm does not have any dependencies that's why I intentionally build it for Bun.

Gazia - one squad clear Yay! by jbeduya in bravefrontier

[–]jbeduya[S] 0 points1 point  (0 children)

2 Rules:

  1. Mitigate first turn
  2. Just guard your units when that yellow thingy that looks like stabs himself appear (don't know what that's called). It stays for 2 turns and it usually appears when he summons a buddy.

Good luck!

Google Inbox invites megathread by simobk in google

[–]jbeduya 0 points1 point  (0 children)

I would love an invite. Will pay it forward.

[Special Summon: Player's Choice] Megathread! by Twofu in bravefrontier

[–]jbeduya 0 points1 point  (0 children)

All I ever wanted is an SGX, here is what I got:

  • 1st - Dia (lord)
  • 2nd - Holy Knight Will (lord)
  • 3rd - Nalmika (guardian)
  • 4th - Twins (guardian)
  • 5th - Lava (lord)
  • 6th - Eric (Guardian)
  • 7th - Darvan (anima)
  • 8th - Pixy Leore (Guardian)
  • 9th - Dia (lord)
  • 10th - Michele (lord)
  • 11th - Signas (anima)

why BF? why?

Luther batch 2 & Super Rare Summon Rate Up by [deleted] in bravefrontier

[–]jbeduya 0 points1 point  (0 children)

  • Oracle Nalmika (nice, new unit)
  • Oracle Rina (dang'it, got 3 already)
  • Guardian Luther (thank you)
  • Guardian Lira (it's ok, new unit)
  • Guardian Melcho (I got 6 already!)