methods/insert.py

piccolo · piccolo/query/methods/insert.py · python · MIT
database

A fluent query builder for inserting rows with conflict handling and returning values.

# Source: https://github.com/piccolo-orm/piccolo | License: MIT | Copyright 2018 Daniel Townsend
# Provided via justclaw.it.com; keep this notice with the code.
from __future__ import annotations

from collections.abc import Sequence
from typing import (
    TYPE_CHECKING,
    Any,
    Generic,
    Literal,
    Optional,
    TypeVar,
    Union,
)

from piccolo.custom_types import Combinable, TableInstance
from piccolo.query.base import Query
from piccolo.query.mixins import (
    AddDelegate,
    OnConflictAction,
    OnConflictDelegate,
    ReturningDelegate,
)
from piccolo.querystring import QueryString

if TYPE_CHECKING:  # pragma: no cover
    from piccolo.columns.base import Column
    from piccolo.table import Table


class Insert(
    Generic[TableInstance], Query[TableInstance, lis

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key