FredyH / MySQLOO

MySQLOO
GNU Lesser General Public License v2.1
140 stars 55 forks source link

[Feature Request] rowsAffected (same as affectedRows) #136

Closed blobles-dev closed 5 months ago

blobles-dev commented 5 months ago

Hi,

Just a little feature request, would be nice to have an alias of :affectedRows() but instead :rowsAffected(). For some reason I keep typing rowsAffected, which is leading me down a rabbit hole of debugging.

I suspect this is very very low priority and I'm cool with that - it would be nice to just have an interchangeable option, but I can live without it.

FredyH commented 5 months ago

I believe you can already implement this yourself:

require("mysqloo")
local QueryMT = FindMetaTable("MySQLOO Query")
QueryMT.rowsAffected = QueryMT.affectedRows
local PreparedQueryMT = FindMetaTable("MySQLOO Prepared Query")
PreparedQueryMT.rowsAffected = PreparedQueryMT.affectedRows
blobles-dev commented 5 months ago

I believe you can already implement this yourself:

require("mysqloo")
local MT = FindMetaTable("MySQLOO Database")
MT.rowsAffected = MT.affectedRows

Wasn't aware of the meta table names, thank you. Saves me 10 seconds of headache :)

blobles-dev commented 5 months ago

Actually - isnt that the database object? wouldn't it be for the query?

FredyH commented 5 months ago

You are right, it is the query of course. I edited my answer.