© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago•
6 replies
daniel_uc

Is this error in Docs for drizzle-kit Running Migrations SQLite

In the following link: https://orm.drizzle.team/kit-docs/overview, it states at the end of the code block for Running Migrations SQLite to write "betterSqlite.close()". However, it closes the database. The code block works when you omit "betterSqlite.close()". According to chatgpt: It appears that the better-sqlite3 package automatically closes the database connection when it is garbage collected or when the Node.js process exits. Therefore, explicitly calling betterSqlite.close() is not necessary in most cases.

Is this an error in the docs or is there a reason for inserting "betterSqlite.close()"? If there is a reason for inserting "betterSqlite.close()" how can we mitigate it closing the database when we run our code. Thanks!
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Error when running migrations in newest drizzle-kit
Drizzle TeamDTDrizzle Team / help
16mo ago
Running drizzle-kit push:sqlite with Turso
Drizzle TeamDTDrizzle Team / help
2y ago
no migrations for pgenums in drizzle-kit
Drizzle TeamDTDrizzle Team / help
3y ago
issue drizzle-kit pull -> drizzle-kit-generate -> drizzle-kit migrations
Drizzle TeamDTDrizzle Team / help
9mo ago