-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update dependency drizzle-orm to ^0.38.0 #115
Open
renovate
wants to merge
1
commit into
main
Choose a base branch
from
renovate/drizzle-orm-0.x
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
renovate
bot
force-pushed
the
renovate/drizzle-orm-0.x
branch
2 times, most recently
from
October 19, 2024 08:08
a0bcb01
to
b378f02
Compare
renovate
bot
force-pushed
the
renovate/drizzle-orm-0.x
branch
from
October 23, 2024 19:40
b378f02
to
c68a68b
Compare
renovate
bot
force-pushed
the
renovate/drizzle-orm-0.x
branch
from
October 24, 2024 23:17
c68a68b
to
7e6adfb
Compare
renovate
bot
force-pushed
the
renovate/drizzle-orm-0.x
branch
from
October 25, 2024 09:18
7e6adfb
to
d70fb7f
Compare
renovate
bot
force-pushed
the
renovate/drizzle-orm-0.x
branch
from
October 26, 2024 06:31
d70fb7f
to
dfa0c34
Compare
renovate
bot
force-pushed
the
renovate/drizzle-orm-0.x
branch
from
October 26, 2024 08:53
dfa0c34
to
32dc5ef
Compare
renovate
bot
force-pushed
the
renovate/drizzle-orm-0.x
branch
from
October 29, 2024 21:08
32dc5ef
to
fb01a3a
Compare
renovate
bot
changed the title
Update dependency drizzle-orm to ^0.35.0
Update dependency drizzle-orm to ^0.36.0
Oct 30, 2024
renovate
bot
force-pushed
the
renovate/drizzle-orm-0.x
branch
from
October 30, 2024 14:17
fb01a3a
to
9b6d36f
Compare
renovate
bot
force-pushed
the
renovate/drizzle-orm-0.x
branch
from
November 5, 2024 02:10
9b6d36f
to
f73a367
Compare
renovate
bot
force-pushed
the
renovate/drizzle-orm-0.x
branch
from
November 8, 2024 03:09
f73a367
to
9688b91
Compare
renovate
bot
force-pushed
the
renovate/drizzle-orm-0.x
branch
from
November 23, 2024 09:09
9688b91
to
bf69e47
Compare
renovate
bot
changed the title
Update dependency drizzle-orm to ^0.36.0
Update dependency drizzle-orm to ^0.37.0
Dec 3, 2024
renovate
bot
force-pushed
the
renovate/drizzle-orm-0.x
branch
from
December 3, 2024 15:56
bf69e47
to
bffc874
Compare
renovate
bot
changed the title
Update dependency drizzle-orm to ^0.37.0
Update dependency drizzle-orm to ^0.38.0
Dec 9, 2024
renovate
bot
force-pushed
the
renovate/drizzle-orm-0.x
branch
from
December 9, 2024 20:08
bffc874
to
1cb1acf
Compare
renovate
bot
force-pushed
the
renovate/drizzle-orm-0.x
branch
from
December 18, 2024 02:59
1cb1acf
to
4691afb
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
None yet
0 participants
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^0.34.1
->^0.38.0
Release Notes
drizzle-team/drizzle-orm (drizzle-orm)
v0.38.0
Compare Source
Types breaking changes
A few internal types were changed and extra generic types for length of column types were added in this release. It won't affect anyone, unless you are using those internal types for some custom wrappers, logic, etc. Here is a list of all types that were changed, so if you are relying on those, please review them before upgrading
MySqlCharBuilderInitial
MySqlVarCharBuilderInitial
PgCharBuilderInitial
PgArrayBuilder
PgArray
PgVarcharBuilderInitial
PgBinaryVectorBuilderInitial
PgBinaryVectorBuilder
PgBinaryVector
PgHalfVectorBuilderInitial
PgHalfVectorBuilder
PgHalfVector
PgVectorBuilderInitial
PgVectorBuilder
PgVector
SQLiteTextBuilderInitial
New Features
getViewSelectedFields
$inferSelect
function to viewsInferSelectViewModel
type for viewsisView
functionValidator packages updates
drizzle-zod
has been completely rewritten. You can find detailed information about it heredrizzle-valibot
has been completely rewritten. You can find detailed information about it heredrizzle-typebox
has been completely rewritten. You can find detailed information about it hereThanks to @L-Mario564 for making more updates than we expected to be shipped in this release. We'll copy his message from a PR regarding improvements made in this release:
And a set of new features
createSelectSchema
function now also accepts views and enums.createUpdateSchema
, for use in updating queries.createSchemaFactory
, to provide more advanced options and to avoid bloating the parameters of the other schema functionsBug fixes
v0.37.0
Compare Source
New Dialects
🎉
SingleStore
dialect is now available in DrizzleThanks to the SingleStore team for creating a PR with all the necessary changes to support the MySQL-compatible part of SingleStore. You can already start using it with Drizzle. The SingleStore team will also help us iterate through updates and make more SingleStore-specific features available in Drizzle
You can check out our Getting started guides to try SingleStore!
New Drivers
🎉
SQLite Durable Objects
driver is now available in DrizzleYou can now query SQLite Durable Objects in Drizzle!
For the full example, please check our Get Started Section
Bug fixes
v0.36.4
Compare Source
New Package:
drizzle-seed
Full Reference
The full API reference and package overview can be found in our official documentation
Basic Usage
In this example we will create 10 users with random names and ids
Options
count
By default, the
seed
function will create 10 entities.However, if you need more for your tests, you can specify this in the seed options object
seed
If you need a seed to generate a different set of values for all subsequent runs, you can define a different number
in the
seed
option. Any new number will generate a unique set of valuesThe full API reference and package overview can be found in our official documentation
Features
Added
OVERRIDING SYSTEM VALUE
api to db.insert()If you want to force you own values for
GENERATED ALWAYS AS IDENTITY
columns, you can useOVERRIDING SYSTEM VALUE
As PostgreSQL docs mentions
Added
.$withAuth()
API for Neon HTTP driverUsing this API, Drizzle will send you an auth token to authorize your query. It can be used with any query available in Drizzle by simply adding
.$withAuth()
before it. This token will be used for a specific queryExamples
Bug Fixes
v0.36.3
Compare Source
New Features
Support for
UPDATE ... FROM
in PostgreSQL and SQLiteAs the SQLite documentation mentions:
Similarly, the PostgreSQL documentation states:
Drizzle also supports this feature starting from this version
For example, current query:
Will generate this sql
You can also alias tables that are joined (in PG, you can also alias the updating table too).
Will generate this sql
In PostgreSQL, you can also return columns from the joined tables.
Will generate this sql
Support for
INSERT INTO ... SELECT
in all dialectsAs the SQLite documentation mentions:
As the PostgreSQL documentation mentions:
And as the MySQL documentation mentions:
Drizzle supports the current syntax for all dialects, and all of them share the same syntax. Let's review some common scenarios and API usage.
There are several ways to use select inside insert statements, allowing you to choose your preferred approach:
Query Builder
Callback
SQL template tag
v0.36.2
Compare Source
New Features
Bug and typo fixes
Fixed typos in repository: thanks @armandsalle, @masto, @wackbyte, @Asher-JH, @MaxLeiter
Fixed .generated behavior with non-strict tsconfig
Fix Drizzle ORM for expo-sqlite
Fixed lack of schema name on columns in sql
fix: Adjust neon http driver entity kind
Export PgIntegerBuilderInitial type
[MySQL] Correct $returningId() implementation to correctly store selected fields
v0.36.1
Compare Source
Bug Fixes
v0.36.0
Compare Source
New Features
Row-Level Security (RLS)
With Drizzle, you can enable Row-Level Security (RLS) for any Postgres table, create policies with various options, and define and manage the roles those policies apply to.
Drizzle supports a raw representation of Postgres policies and roles that can be used in any way you want. This works with popular Postgres database providers such as
Neon
andSupabase
.In Drizzle, we have specific predefined RLS roles and functions for RLS with both database providers, but you can also define your own logic.
Enable RLS
If you just want to enable RLS on a table without adding policies, you can use
.enableRLS()
As mentioned in the PostgreSQL documentation:
Roles
Currently, Drizzle supports defining roles with a few different options, as shown below. Support for more options will be added in a future release.
If a role already exists in your database, and you don’t want drizzle-kit to ‘see’ it or include it in migrations, you can mark the role as existing.
Policies
To fully leverage RLS, you can define policies within a Drizzle table.
Example of pgPolicy with all available properties
Link Policy to an existing table
There are situations where you need to link a policy to an existing table in your database.
The most common use case is with database providers like
Neon
orSupabase
, where you need to add a policyto their existing tables. In this case, you can use the
.link()
APIMigrations
If you are using drizzle-kit to manage your schema and roles, there may be situations where you want to refer to roles that are not defined in your Drizzle schema. In such cases, you may want drizzle-kit to skip managing these roles without having to define each role in your drizzle schema and marking it with
.existing()
.In these cases, you can use
entities.roles
indrizzle.config.ts
. For a complete reference, refer to the thedrizzle.config.ts
documentation.By default,
drizzle-kit
does not manage roles for you, so you will need to enable this feature indrizzle.config.ts
.In case you need additional configuration options, let's take a look at a few more examples.
You have an
admin
role and want to exclude it from the list of manageable rolesYou have an
admin
role and want to include it in the list of manageable rolesIf you are using
Neon
and want to exclude Neon-defined roles, you can use the provider optionIf you are using
Supabase
and want to exclude Supabase-defined roles, you can use the provider optionRLS on views
With Drizzle, you can also specify RLS policies on views. For this, you need to use
security_invoker
in the view's WITH options. Here is a small example:Using with Neon
The Neon Team helped us implement their vision of a wrapper on top of our raw policies API. We defined a specific
/neon
import with thecrudPolicy
function that includes predefined functions and Neon's default roles.Here's an example of how to use the
crudPolicy
function:This policy is equivalent to:
Neon
exposes predefinedauthenticated
andanaonymous
roles and related functions. If you are usingNeon
for RLS, you can use these roles, which are marked as existing, and the related functions in your RLS queries.For example, you can use the
Neon
predefined roles and functions like this:Using with Supabase
We also have a
/supabase
import with a set of predefined roles marked as existing, which you can use in your schema.This import will be extended in a future release with more functions and helpers to make using RLS and
Supabase
simpler.For example, you can use the
Supabase
predefined roles like this:The
/supabase
import also includes predefined tables and functions that you can use in your applicationThis allows you to use it in your code, and Drizzle Kit will treat them as existing databases,
using them only as information to connect to other entities
Let's check an example of adding a policy to a table that exists in
Supabase
Bug fixes
v0.35.3
Compare Source
New LibSQL driver modules
Drizzle now has native support for all
@libsql/client
driver variations:@libsql/client
- defaults to node import, automatically changes to web if target or platform is set for bundler, e.g.esbuild --platform=browser
@libsql/client/node
node compatible module, supports :memory:, file, wss, http and turso connection protocols@libsql/client/web
module for fullstack web frameworks like next, nuxt, astro, etc.@libsql/client/http
module for http and https connection protocols@libsql/client/ws
module for ws and wss connection protocols@libsql/client/sqlite3
module for :memory: and file connection protocols@libsql/client-wasm
Separate experimental package for WASMv0.35.2
Compare Source
We've added approximately 240 tests to check the ESM and CJS builds for all the drivers we have. You can check them here
v0.35.1
Compare Source
v0.35.0
Compare Source
Important change after 0.34.0 release
Updated the init Drizzle database API
The API from version 0.34.0 turned out to be unusable and needs to be changed. You can read more about our decisions in this discussion
If you still want to use the new API introduced in 0.34.0, which can create driver clients for you under the hood, you can now do so
in order to not introduce breaking change - we will still leave support for deprecated API until V1 release.
It will degrade autocomplete performance in connection params due to
DatabaseDriver
|ConnectionParams
types collision,but that's a decent compromise against breaking changes
New Features
New .orderBy() and .limit() functions in update and delete statements SQLite and MySQL
You now have more options for the
update
anddelete
query builders in MySQL and SQLiteExample
New
drizzle.mock()
functionThere were cases where you didn't need to provide a driver to the Drizzle object, and this served as a workaround
Now you can do this using a mock function
There is no valid production use case for this, but we used it in situations where we needed to check types, etc., without making actual database calls or dealing with driver creation. If anyone was using it, please switch to using mocks now
Internal updates
Bug fixes
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.