Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme Select: Cols vs Set functionality is unclear #14

Closed
jakeasmith opened this issue Mar 24, 2014 · 9 comments
Closed

Readme Select: Cols vs Set functionality is unclear #14

jakeasmith opened this issue Mar 24, 2014 · 9 comments

Comments

@jakeasmith
Copy link
Contributor

From this example its not obvious that set() is its own key-value pair unrelated to cols() and bind*(). Consider splitting set() into its own example.

$insert
    ->into('foo')                   // INTO this table
    ->cols([                        // insert these as "(col) VALUES (:col)"
        'bar',
        'baz',
    ])
    ->set('id', 'NULL')             // insert raw values for this column
    ->bindValue('foo', 'foo_val')   // bind one value to a placeholder
    ->bindValues([                  // bind these values
        'bar' => 'foo',
        'baz' => 'zim',
    ]);
@harikt
Copy link
Member

harikt commented Mar 25, 2014

@jakeasmith would love to get a PR. Thanks.

@jakeasmith
Copy link
Contributor Author

I don't have time right now, but I wanted to at least open up the issue here. Its tripped my team up more than once.

@harikt
Copy link
Member

harikt commented Mar 25, 2014

@jakeasmith sure. I just mentioned.
Someone can work on when we have time.
Thank you

@harikt
Copy link
Member

harikt commented Mar 26, 2014

@jakeasmith I am not sure whether moving to set will help.

pmjones pushed a commit that referenced this issue Apr 15, 2014
@pmjones
Copy link
Member

pmjones commented Apr 15, 2014

I just modified the read me very slightly. Let me know if that helps.

Regarding the phrase "its not obvious that set() is its own key-value pair unrelated to cols() and bind*()" -- I don't think it's unrelated. The set() method is a raw connection to the column/value pairs. You could mimic cols()+bind() by calling set() multiple times and passing your own values.

@jeremyjannotta
Copy link

I think the biggest thing that wasn't clear to me, was that you can use set() OR cols() OR both, partly because the example shows them used all together. So showing them in separate examples is one way that could help explain the usage.

@pmjones
Copy link
Member

pmjones commented Apr 15, 2014

/me nods

I'm not sure how to write that up -- if you could send a PR that would help a great deal.

@pmjones
Copy link
Member

pmjones commented May 15, 2014

Guys, I'm sorry, I don't know how to write this up any better. If you can send a PR with better examples I'll be happy to review it. In the mean time, I'm closing this issue; I can reopen it or reference it later as needed.

@pmjones pmjones closed this as completed May 15, 2014
@harikt
Copy link
Member

harikt commented May 16, 2014

may be we close it once they feel it is addressed ? I know our release script probably won't allow for it :( .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants