Skip to content

Releases: octet-stream/better-auth-mikro-orm

v0.4.3

13 Jul 18:15
1560a15
Compare
Choose a tag to compare

Patch Changes

v0.4.2

13 Jul 11:16
e9996aa
Compare
Choose a tag to compare

Patch Changes

  • #23 1407666 Thanks @octet-stream! - Use nativeDelete and nativeUpdate ORM methods for updateMany/deleteMany. However, this change mean that Identity Map won't be updated after deleteMany and updateMany methods.

  • #20 31f3fb1 Thanks @octet-stream! - Remove orm.em.clear usage from adapter.updateMany

  • #22 fe209dc Thanks @octet-stream! - Use getReference to ensure references loaded correctly

v0.4.1

09 Jul 11:03
011376c
Compare
Choose a tag to compare

Patch Changes

  • #16 f385105 Thanks @octet-stream! - Replace nativeDelete with remove method to delete rows to properly update IdentityMap in adapter.deleteMany method.

v0.4.0

11 Jun 19:22
d28b2d7
Compare
Choose a tag to compare

Minor Changes

Patch Changes

v0.3.0

21 Apr 14:52
b442d41
Compare
Choose a tag to compare

Minor Changes

v0.2.0

26 Dec 15:22
f541e29
Compare
Choose a tag to compare

Minor Changes

v0.1.1

20 Dec 13:23
426bf22
Compare
Choose a tag to compare

Patch Changes

v0.1.0 - Initial release

16 Dec 18:17
d16af14
Compare
Choose a tag to compare

Implement Mikro ORM adapter.

Usage:

  1. First you'll need to set up Mikro ORM and define the core schema for Better Auth.
    If you use any plugin - don't forget to check if they have any additional database schema definitions, then define entities you'll need for each plugin.
  2. When you finished with the schema definition you can simply pass the result of mikroOrmAdapter call to the database option like this:
import {mikroOrmAdapter} from "better-auth-mikro-orm"
import {betterAuth} from "better-auth"

import {orm} from "./orm.js" // Your Mikro ORM instance

export const auth = betterAuth({
  database: mikroOrmAdapter(orm),

  // Don't forget to disable ID generator if it already managed by Mikro ORM:
  advanced: {
    generateId: false
  }
})