Skip to content

table.create(..., replace=True) #568

@simonw

Description

@simonw

Found myself using this pattern to quickly prototype a schema:

import sqlite_utils
db = sqlite_utils.Database(memory=True)

print(db["answers_chunks"].create({
    "id": int,
    "content": str,
    "embedding_type_id": int,
    "embedding": bytes,
    "embedding_content_md5": str,
    "source": str,
}, pk="id", transform=True).schema)
image

Using replace=True to drop and then recreate the table would be neat here, and would be consistent with other places that use replace=True.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions