Skip to content

Add FromRow and ToRow traits #28

Closed
@lilac

Description

@lilac

Support converting a basic Rust value from and to a PostgresRow instance, so that the insertion and query api would be much cleaner.

For example, instead of

conn.execute("INSERT INTO person (name, time_created, data)
                    VALUES ($1, $2, $3)",
                 [&me.name as &ToSql, &me.time_created as &ToSql,
                  &me.data as &ToSql]);

you write

conn.execute("INSERT INTO person (name, time_created, data)
                    VALUES ($1, $2, $3)", me.toRow());

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