Logo

    797: Drizzle: The TypeScript SQL ORM

    enJuly 19, 2024
    What is Drizzle and its purpose?
    How does Drizzle differ from Prisma and Keyzly?
    What challenges did the Drizzle team face in development?
    What improvements are being made to Drizzle's API?
    How does Drizzle Kit assist with database migrations?

    Podcast Summary

    • Drizzle ORM developmentThe Drizzle ORM was developed to make databases easier to work with in TypeScript projects, with a focus on being opt-in, type-safe, discoverable, and having a SQL-like API. However, the initial decision to make it 100% type-safe led to developer frustration and errors, and the team learned the importance of balancing type safety and developer experience.

      Drizzle, an ORM for working with databases in TypeScript, was developed out of a need to make databases easier to work with in their team's projects. The team, previously working on various projects in Java, Python, Golang, and TypeScript, identified the need for an ORM that was opt-in, type-safe, discoverable, and had a SQL-like API. They followed this manifest in their design decisions, except for the initial iteration of making the ORM 100% type-safe. This decision proved to be a disadvantage as it required developers to write every type and led to massive TypeScript errors, making the API less developer-friendly. The team realized that striking a balance between type safety and developer experience was crucial in creating an effective ORM. Drizzle's collaboration with Syntax marks an exciting new chapter for the project, with a portion of the proceeds from the limited-edition t-shirts going directly to the Drizzle project.

    • TypeScript type inference in DrizzleDrizzle's development involves complex work in TypeScript type inference, but the team balances this with keeping the user experience simple. ORMs can be used for query building and schema introspection, but it's important to use them appropriately. Drizzle offers flexibility in how it's used and prioritizes making data management simple and robust.

      The development of a data library like Drizzle involves complex work, particularly in the area of TypeScript type inference. While some team members have specialized in this area, others prioritize keeping the user experience simple. ORMs (Object-Relational Mapping) like Drizzle can be a valuable tool for mapping database data to TypeScript objects, but it's essential to use them appropriately. Some developers prefer to keep their ORM use minimal and only use it for query building and schema introspection. Others may opt for more advanced features like migrations and relational CPI. Drizzle is designed to be flexible and can be used in various ways depending on a project's needs. The team behind Drizzle emphasizes the importance of making data management as simple as possible for developers while still providing powerful features. When it comes to filters, Drizzle offers two ways to write them: using functions or importing methods directly. This design choice is due to the security considerations in the query builder and the flexibility of the relational API. Overall, Drizzle aims to make data management more robust and sustainable for developers while keeping the user experience as straightforward as possible.

    • Drizzle's approach to schema objectsDrizzle's team recognizes the limitations of their current relational API and is working on improvements, prioritizing SQLite performance and flexibility, and offering dialect-specific branches, while believing that explicitly importing and referencing schema objects provides benefits for easier navigation and better understanding of data.

      The team behind Drizzle recognizes the limitations of their current relational API and is working on improvements. They believe that explicitly importing and referencing schema objects in queries provides benefits such as easier navigation and better understanding of the data being queried. This approach differs from some other ORMs like Prisma and Keyzly, with Drizzle prioritizing SQLite performance and flexibility, and offering dialect-specific branches. The team has learned from evaluating these tools and is making changes based on their experiences. Despite the need to import tables and functions, they believe the benefits of their approach outweigh the downside.

    • Database tools: Drizzle and PrismaBoth Drizzle and Prisma offer advanced query generation and CRUD functionality, with Drizzle focusing on custom query dialects for various databases and Prisma building SQL queries into their platform.

      Drizzle and Prisma, two popular database tools, share similarities while also offering unique features. Both teams have learned from each other, with Drizzle focusing on advanced query generation for complex relation queries and Prisma building an SQL query into their platform. They aim to provide a superior development experience with a solid query builder and CRUD functionality, which they refer to as "query plus CRUD." While Drizzle supports various databases and query APIs, the choice depends on business demands. The complexities of database providers and their specific features are important considerations. Drizzle's approach to maintaining separate dialects for each database helps them iterate faster without introducing issues to previous versions. Despite their differences, both teams aim to improve each other and provide the best benefits for developers.

    • Drizzle's commitment to dedicated database toolDrizzle prioritizes efficiency and commitment to a particular database dialect over flexibility, offering a high-quality, dedicated database tool with features like Drizzle Studio and a Chrome extension for improved user experience.

      Drizzle, a database tool, prioritizes efficiency and commitment to a particular database dialect over flexibility. The team believes that constantly switching databases can lead to unnecessary work and a suboptimal developer experience. Instead, they focus on providing a high-quality, dedicated database tool, including Drizzle Studio, a GUI for editing databases and viewing data. Drizzle Studio was initially met with resistance due to the lack of this feature, but the team eventually developed it and saw significant success. They have also made it embeddable for other companies, making it a versatile and valuable tool for various databases. The team's approach to database management is unique in that they prioritize a seamless and efficient experience over the flexibility to switch databases at will. They have also shown a commitment to improving their product by adding features like Drizzle Studio and exploring partnerships with other database vendors. Additionally, the team has developed a Chrome extension to get around limitations with certain databases, such as Cloudflare D1, which don't offer a native dashboard. This extension allows users to send requests through their webpage and represent the data, providing a better user experience than what the vendor offers. Overall, Drizzle's approach to database management emphasizes efficiency, commitment, and innovation, making it a valuable tool for developers looking for a dedicated and high-quality database solution.

    • Drizzle Kit migrations toolDrizzle Kit's migrations tool simplifies database migrations for developers, even for those with less experience, by generating queries for them, enabling faster iteration and supporting various databases like PgLite and SQLite.

      Drizzle Kit's migrations tool is designed to make database migrations easier for developers, even for those with less experience, by generating queries for them. This approach allows developers to focus on their work without worrying about the underlying query generation process. The tool's history traces back to the Java version of Drizzle ARAM, where migration tools were built directly into the codebase. However, this approach led to issues when schema changes occurred, resulting in a "migration cemetery" where old migrations were stored. Drizzle Kit's current migrations tool aims to simplify the process and enable faster iteration, making it particularly useful for developers coming from databases like MongoDB where schema changes are more common. Additionally, Drizzle Studio is expanding its support to include databases like PgLite and SQLite, making it a versatile tool for local data storage. Despite the challenges faced in Ukraine, the Drizzle team continues to develop and improve their tools, prioritizing work and finding ways to maintain productivity in the face of adversity.

    • Ukraine conflict impact on Drizzle teamDespite significant challenges from the ongoing conflict in Ukraine, the Drizzle team has adapted, continued their open-source project, and explored new initiatives, showing resilience and determination. Community support and sponsorships have been crucial to their survival.

      The Drizzle team in Ukraine, despite facing significant challenges such as power and internet outages due to ongoing conflict, has adapted and continued to work on their open-source project and explore new initiatives. They have implemented creative solutions like using Starlink and power banks, and have even expanded their team and begun developing new products. While they currently operate at a financial loss, they remain optimistic and committed to their mission. The team's resilience and determination serves as an inspiration, showing that even in the most challenging circumstances, progress and innovation can still be achieved. The situation in Ukraine has highlighted the importance of community support and sponsorships, which have played a crucial role in keeping the team afloat. The team's experience also underscores the psychological impact of living through prolonged power and internet outages, and the immense challenge it poses to productivity and creativity.

    • Innovation in DrizzleThe creators of Drizzle are deeply invested in their project, constantly innovating, and passionate about improving the user experience, even if it means financial losses.

      Andrew and Alex, the creators of Drizzle, are deeply invested in their project and believe in its potential, even if it means making financial losses in the present. They are passionate about the product and the care they put into it, which resonates with users. During the conversation, they shared exciting discoveries, such as advanced swimming goggles that display pace, heart rate, and GPS while swimming, making open water navigation easier. They also encouraged listeners to support various charitable causes and the Drizzle project itself through sponsorships and merchandise purchases. Overall, the discussion highlighted the team's dedication to innovation and improving the user experience.

    Recent Episodes from Syntax - Tasty Web Development Treats

    817: You Need These 30 Apps - PART 1

    817: You Need These 30 Apps - PART 1

    Scott and Wes kick off part 1 of a 2-part series, breaking down 30 must-have apps for web developers and productivity enthusiasts. From file management tools to media utilities, they cover everything you need to supercharge your workflow.

    Show Notes

    Sick Picks

    Shameless Plugs

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott: X Instagram Tiktok LinkedIn Threads

    Randy: X Instagram YouTube Threads

    816: Why Your CSS Sucks

    816: Why Your CSS Sucks

    Scott and Wes break down why your CSS might suck—from misusing specificity to not leveraging CSS variables. Tune in as they dive into common pitfalls that are making your stylesheets a hot mess.

    Show Notes

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott: X Instagram Tiktok LinkedIn Threads

    Randy: X Instagram YouTube Threads

    815: Deno 2 with Ryan Dahl

    815: Deno 2 with Ryan Dahl

    In this episode of Syntax, Wes and Scott talk with Ryan Dahl about Deno 2.0, its new features and use of web standards, and how it seamlessly integrates with popular frameworks like Next.js. Ryan shares insights on the motivations behind Deno’s creation, its emphasis on simplicity and security, and offers his take on the evolving JavaScript ecosystem.

    Show Notes

    Sick Picks

    Shameless Plugs

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott: X Instagram Tiktok LinkedIn Threads

    Randy: X Instagram YouTube Threads

    814: Fundamentals: HTML

    814: Fundamentals: HTML

    In this episode of Syntax, Wes and Scott talk about HTML fundamentals — from basic structure and semantics to practical tips for better accessibility and SEO. They also discuss the difference between block and inline elements, form functionalities, HTML5 elements like dialog and canvas, and more.

    Show Notes

    Sick Picks

    Shameless Plugs

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott: X Instagram Tiktok LinkedIn Threads

    Randy: X Instagram YouTube Threads

    813: CSS: Scroll Driven Animations

    813: CSS: Scroll Driven Animations

    In this episode of Syntax, Wes and Scott talk about CSS’ new scroll-driven animations, its implementation, uses, and potential pitfalls. They also discuss animation-timeline and animation-range, and how they can be utilized to control animations based on scroll positions.

    Show Notes

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott: X Instagram Tiktok LinkedIn Threads

    Randy: X Instagram YouTube Threads

    812: CSS 4, 5, and 6! With Google’s Una and Adam

    812: CSS 4, 5, and 6! With Google’s Una and Adam

    In this episode of Syntax, Wes and Scott talk with Una Kravetz and Adam Argyle from Google Chrome about the evolution of CSS, new features, and the push toward more advanced UI capabilities on the web. They discuss the introduction of CSS versioning, exciting new properties like text-box-trim, state queries, and scroll state functionalities, select, and more!

    Show Notes

    Sick Picks

    Shameless Plugs

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott: X Instagram Tiktok LinkedIn Threads

    Randy: X Instagram YouTube Threads

    How To Stay Up To Date with Daily.dev’s Francesco Ciulla

    How To Stay Up To Date with Daily.dev’s Francesco Ciulla

    In this episode of Syntax, Scott and Wes talk with Daily.dev’s Francesco Ciulla about the platform's history, community features, and significant growth. They dive into the core ideas behind daily.dev, including its personalized feed for developers, new features like squads, community contributions, and tech stack. Francesco also shares his passion for Rust, and highlights the importance of content creation in the ever-evolving tech landscape.

    Show Notes

    Sick Picks

    Shameless Plugs

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott: X Instagram Tiktok LinkedIn Threads

    Randy: X Instagram YouTube Threads

    808: The Future of JavaScript Frameworks × Building Auth × DB Design Tips, and more!

    808: The Future of JavaScript Frameworks × Building Auth × DB Design Tips, and more!

    In this potluck episode of Syntax, Wes and Scott answer your questions about the future of JavaScript frameworks, building custom authentication systems, limiting API access, using Caddy server proxy for local development, component props in JSX, structuring a relational database, and more!

    Show Notes

    Sick Picks

    Shameless Plugs

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott: X Instagram Tiktok LinkedIn Threads

    Randy: X Instagram YouTube Threads