Skip to content

Consistent short parameter syntax #65

@g105b

Description

@g105b

I really like the short parameter syntax. It's great for reducing repetition. However, I want to enforce its use to be explicit, rather than implicitly used in set operations.

For example, at the moment, this is how I write an update:

return new UpdateBuilder()
	->table("todo")
	->set("title")
	->where(":id");

The :id expands to id = :id, but currently the single-parameter set also does this --- but I think that's too confusing.

This is what it should look like:

return new UpdateBuilder()
	->table("todo")
	->set(":title")
	->where(":id");

The extra colon is instantly more readable. I understand that :title will be expanded to a named placeholder, just as it does in the where, but it also means I have the ability to write the set long-hand without worrying about implicit field expansions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions