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

kebab-case #22

Closed
tokuhirom opened this issue Oct 8, 2015 · 7 comments
Closed

kebab-case #22

tokuhirom opened this issue Oct 8, 2015 · 7 comments

Comments

@tokuhirom
Copy link

There's some lower_case methods. I suggest to rename these methods before christmas.

@azawawi
Copy link
Contributor

azawawi commented Oct 9, 2015

Do we need to keep the old ones as deprecated and add the new ones?

@moritz
Copy link
Contributor

moritz commented Oct 18, 2015

yes please. And rethink the method names in general. Anything with ref is suspicious.

Oh, and we have lazy lists now. Which means that

while my @row = $sth.fetchrow_array {...} 

Should really be

 for $sth.rows -> @row { ... }

And if one wants the row as a hash, it should probably be $sth.rows(:hash).

@Skarsnik
Copy link
Contributor

I am actually playing around with this in DBI (deprecating all the fetch**)

There is one issue with using rows . it's already used to get the number of rows affected/returned by the statement.

For now I will try with row and allrows (with the :hash adverb). There is also the issue of #31 Since every sane drivers provide a way to get the type of the column, I was thinking of the 'modern perl6' method (aka row and allrows) always returning a typed value with this, since everything has a .Str method

There is also another issue. What to do with large string field or blob field? We can return a copy but it's probably not really ram friendly, but if we return what the C lib give us, it can became easily lost memory since (in case of Pg for example) we need to call a clear routine on this.

@Skarsnik
Copy link
Contributor

I did not figure how to have for $sth.row -> @Row work with having $std.row only returning one result for now.
You can have a look at https://github.com/Skarsnik/DBIish For now I keep all the old stuff and just deprecated nearly every fetch* stuff. (Only Pg/SQLite have row)
For the $sth.allrows() I am planning of having a allrows(:array-of-hash) and allrows(:hash-of-array) 'option' to be able to choose how you want the data with a hash form.

I am not sure if all *ref are really useful in perl6, so I just forget about them.

@Skarsnik
Copy link
Contributor

Should I close that and deprecate all the _ to keep only the kebab cased method?

@Row
Copy link

Row commented Dec 16, 2015

Ok

@rbt
Copy link
Collaborator

rbt commented Jul 11, 2020

The old DBI fetch* stuff was deprecated in d0c1d05 and the README has been updated since. I think everything in this discussion is complete.

The internal code is still a mix of underscore, kebab-case and dashed variables but that seems a separate issue.

@rbt rbt closed this as completed Jul 11, 2020
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

6 participants