Commit Graph

29 Commits

Author SHA1 Message Date
KinfeMichael Tariku
af402dba3a fix: add a default value for generated fields 2025-05-02 00:29:32 +03:00
Maxwell
c6eb16e626 fix(cli): schema gen with Drizzle for PG to generate text instead of uuid (#2248) 2025-04-13 14:30:16 +03:00
Maxwell
986614b241 feat: createAdapter and useNumberId (#1926)
* refactor(adapter): `createAdapter` helper

* update: Kysely adapter support

* update: memory adapter

* chore: cleanup

* update: MongoDB adapter supported

* update: mongodb adapter file names

* update: support for prisma adapter

- also fixed memory adapter with `getField`
- disabled all debug logs by default

* chore: lint

* fix: generate an `id` if it isn't already provided

* update(test): init config snapshot

* update: existing adapters tests to include an `id` existence check

* fix: renamed prisma adapter file names

* ^

* update(mongo): Removed `disableIdGeneration` for mongo adapter

* fix: dont add `id` from fields if `disableIdGeneration` is false

* fix: adapter converting dates to string using the wrong value data

* add: create-adapter tests

* update: moved `adapter` to `create-adapter` under the existing `adapters` folder

* WIP: docs

* fix: create-adapter test importing from wrong path

* WIP: docs

* update: key transformation map options are now objs not fns

* chore: lint

* update: cleanup & added debugLogs/usePlural option to some adapters

* update: tests

* chore: cleanup

* update: fields name & made customTransforminput/output to run after supportsDates/supportsBoolean/SupportsJSON to run

* chore: lint

* Update: docs

* update: update-many to not use transformOutput

* chore: lint

* fix: adapter options breaking

* update: set the default limit on findMany

* update: docs

* update: docs & cleaned up code

* update: create schema comes with `tables` now

* This is useless

* fix: api-key shouldn't handle id gen in row creation

* chore: lint

* WIP: useNumberId

* chore: cleanup

* removed all cases of `id` during adapter.create call

* update: useNumberId

* update: drizzle adapter schema generation

- update: pg now sets `id` field to use `uuid`.
- fix: sets the correct reference `onDelete` action.
- refactor: cleaned up the code a lot more

* update: added `supportNumericIds` in create adapter options

* chore: cleanup

* update(tests): added option to disable any adapter tests & created a `useNumberId` test

* fix: skip tests options were using old method

* chore: lint

* WIP: Drizzle tests with number id

* chore: lint

* fix: memory adapter failing on number id adapter tests

* chore: cleanup

* fix: adapter tests fail due to emails needing to be unique

* update: support drizzle adapter use-number-id

* fix: cleanup Drizzle Adapter tests

* fix: drizzle schema generation for reference id fields

* fix: type errs in memory adapter tests

* fix: memory adapter tests

* Update init.test.ts.snap

* fix: prisma tests correctly uses the right primsa client per schema

* Delete run-vitest.ts

* update: create-adapter to support `getDefaultFieldName`

* update: create-adapter adapter options updated

* fix: adapters using older function names

* fix: create-adapter now converts where clauses & added tests

* update: new `getFieldAttributes` option in create-adapter, and fixed convert where clause fn

* chore: cleanup

* update: convertWhereClause in create-adapter improved

* update: BAOptions to start using `database` & updated adapter tests

* fix: type errors

* chore: lint

* update: default config values for the create-adapter config

* fix: getModelName doesnt take into account of plural

* chore: cleanup

* update: improved getDefaultModelname

* fix: create-adapter transform input doesn't take into account reference IDs

* fix: transformInput on reference IDs doesn't take into account of array IDs

* chore: lint

* fix: prisma tests

* fix: Prisma adapter tests running one after another

* fix: init snapshot should state supportJSON as `false`

* fix: drizzle adapter tests

* update: adapter test options to allow passing a test prefix

* chore: add state.txt to gitignore

* remove: state.txt from gitignore, it's useless

* chore: lint

* Update adapter.prisma.numberid.test.ts

* fix: get-migration for mysql & mssql `id` fields to use varchar

* chore: cleanup

* update: adapter comes with adapter-test-debug-log functions

* update: made adapterTestDebugLog functions only be in adapter if config enabled it

* fix: transactionId for debug logs not working correctly

This was due to the adapter being reinitialized each test case

* update: Added colors to debug logs

* update: adapter tests a little more refined

* add: deepmerge dev deps to deep merge better auth options config for adapters

* fix: create-adapter types

* update: revert back to old types

* fix: prisma adapter tests now run one after another

* fix: kysely adapter to work when no `id` is provided

* update: mongoDB to set `supportNumericids` to false

* update(docs): discuss new `database` object in BetterAuthOptions

* add: support for custom ID generation

* fix: docs had incorrect default value for `supportsJSON`

* update(docs): added number id adapter test documentation

* fix: drizzle-adapter mysql tests

* update: drizzle-adapter tests to use deepmerge

* add: drizzle-adapter mysql tests to test useNumberId

* add: Prisma generate to support number id

* update: support the old `generateId` option, but warn the user for deprecation

* update: init test snapshot

* update: adapter tests not included in normal tests

* Update pnpm-lock.yaml

* fix: typo in file names for kysley test files

* update: separated adapter tests

* Update pnpm-lock.yaml

* fix: please tell me I actually fixed this

* fix: pnpm-lock merge conflict

* chore: lint

* fix: sveltekit pkg.json merge conflicts (hopefully)

* Delete pnpm-lock.yaml

* update: createSchema takes into account of rate-limit and secondaryStorage

* improve docs

* add drizzle returning id retriver

* chore: fix test script

---------

Co-authored-by: Bereket Engida <bekacru@gmail.com>
2025-04-11 09:04:49 +03:00
Bereket Engida
b5f638ca45 docs: upgrade to tailwind v4, react 19, fuma docs 15 (#1735) 2025-03-08 19:33:31 +03:00
Bereket Engida
7ba1af2ff9 Merge branch 'main' into v1.2 2025-02-27 14:20:23 +03:00
PitonsSkipper
1ecc717483 fix: add last semi-colon to the compiled migrations to support Cloudflare D1 migration (#1569)
* Update get-migration.ts

Add last semi-colon to the compiled migrations

* Update test snapshot migrations.sql
2025-02-25 12:12:02 +03:00
Bereket Engida
2c81e5bf8f Merge branch 'main' into v1.2 2025-02-14 15:17:41 +03:00
Bereket Engida
047d677966 feat: support stroring dispaly username to store un-normalized username (#1204)
* feat: support stroring dispaly username to store un-normalized username

* test: update snapshot
2025-02-14 12:33:24 +03:00
Greg Jackson
f011c741e6 fix(cli): add on delete cascade constraint to drizzle references (#1419) 2025-02-12 08:39:00 +03:00
KinfeMichael Tariku
0794de2c71 fix(drizzle): drizzle with mysql update breaks on anything other than update by id(#1377)
---------

Co-authored-by: Bereket Engida <bekacru@gmail.com>
2025-02-08 11:11:37 +03:00
Bereket Engida
db4b4fce40 feat: support .js config (#1256) 2025-01-21 14:19:34 +03:00
Bereket Engida
bfc8f15aad fix(drizzle): default to snake-case (#1012) 2024-12-24 13:04:14 +03:00
Bereket Engida
0eacf0182d refactor: standardize how session and user data is returend in endpoints (#968) 2024-12-21 01:58:35 +03:00
Bereket Engida
92e249139f chore: fix cli snapshot 2024-12-20 23:00:16 +03:00
Marc Mogdanz
8dffaa2cd6 docs: use APIRoute instead of Route for tanstack start api routes (#943)
* fix(docs): use `APIRoute` instead of `Route` for tanstack start api routes

* fix(cli): remove unused import in drizzle schema
2024-12-20 20:59:52 +03:00
Bereket Engida
cc1666d92d docs: add section on how to use error codes 2024-12-08 14:30:24 +03:00
Bereket Engida
0aaa573a32 fix(drizzle): it should use text for id fields other than mysql (#719) 2024-12-02 12:26:43 +03:00
Bereket Engida
ee705a5f26 fix: prisma schema generator should add @db.text for mysql and generate many fields (#718) 2024-12-02 12:01:54 +03:00
Bereket Engida
783378458d chore: update snapshot 2024-11-29 20:32:19 +03:00
Bereket Engida
4b92d71d64 chore: update snapshot 2024-11-23 03:29:54 +03:00
Bereket Engida
e350a31044 fix: migration should use appropriate data type for each db (#572) 2024-11-18 16:36:43 +03:00
Bereket Engida
223d27bde5 chore: update snapshot 2024-11-15 20:52:48 +03:00
Bereket Engida
5422b05205 feat: add created at field on verification table (#506) 2024-11-15 16:08:57 +03:00
Bereket Engida
0775612256 feat: native adapter interfaces (#513) 2024-11-13 19:28:11 +03:00
Bereket Engida
f3352560e0 chore:lint 2024-10-26 16:55:52 +03:00
Nico Lynzaad
c4f405beb2 fix(cli): enhance alias path resolution (#344) 2024-10-26 16:55:23 +03:00
Bereket Engida
a573f941b1 fix: add mongodb id map and support array type gen for prisma (#243) 2024-10-19 14:33:49 +03:00
Bereket Engida
6826e2e58e feat: custom id generation (#221)
* feat: custom id generation

* fix test

* fix: failing tests
2024-10-18 09:17:48 +03:00
Bereket Engida
2953fe882d refactor: move cli to it's own pacakge (#176)
* refactor

* cleanup and more refactor

* test: cli

* chore: release v0.4.9-beta.12

* feat: kysley generate and orm migrations

* chore: release v0.4.9-beta.13

* test: generate

* test: change test snapshot file

* docs

* chore: lint

* fix: test

* chore: release v0.4.9-beta.14

* chore: release v0.4.9
2024-10-15 16:35:14 +03:00