lua-resty-mysql
lua-resty-mysql copied to clipboard
implement connection mysql server with charset (default charset is utf8)
Note : I don't use in product yet.
First of all, thank you for your contribution!
But I can see that there are some minor issues in your patch:
- could you strictly follow the Lua coding style used in this library? I see you're using inconsistent indentations and spaces around binary operators like "=" and "%", for example.
- I think logically the client should not default to UTF-8 but rather default to the server-side settings. Also, this way we won't break backward compatibility of this library.
- Could you add some test cases for this change to the existing test suite?
- I think it is a good idea to move the charsetlist table to the module toplevel scope so that we don't have to construct this big Lua table every time we call the _getcharset function in connect().
- You declare and initialize the new "strfmt" local variable but you never use it in your patch.
- Have you tested your patch with earlier versions of MySQL like 5.5 or 5.1?
Will you update the patch accordingly?
Thanks for your patience! -agentzh
thank you for review the code . I update the patch accordingly . I am using vim edit lua code .so can you give me some extra help for development for lua with nginx .thank you how create unit test script for lua thank you .
@zhaojp0411 you can take a look at my .vimrc file here: http://agentzh.org/misc/.vimrc