Skip to content

feat: Drizzle ORM for improved data transformation #23

@madjin

Description

@madjin

Add Drizzle ORM for Improved Data Transformation

Overview

Implement Drizzle ORM to replace current manual SQL operations and data transformations in the storage layer.

Background

Currently, the codebase has several implicit data transformations:

  • Source plugins convert external data to ContentItem objects
  • Generator components transform content into structured summaries
  • We manually map between database records and application models

Drizzle ORM would provide type-safe schema definitions and simplify these transformations.

Proposed Solution

  1. Create schema definitions for ContentItem and SummaryItem models
  2. Implement a new DrizzleStorage class that implements the StoragePlugin interface
  3. Add configuration support for the new storage implementation

Benefits

Drizzle ORM would help by:

  1. Replacing manual data mapping in SQLiteStorage with type-safe schema definitions
  2. Automating JSON serialization/deserialization for complex fields
  3. Eliminating redundant transformation code between database and application models
  4. Providing consistent data validation and conversion across the application

This would reduce code complexity and increase type safety in the data transformation pipeline.

Implementation Complexity

  • Medium effort (estimated 1-2 days of development time)
  • Can be implemented incrementally alongside existing storage
    • Would be a new source that can be loaded from config

Next Steps

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions