On Wed, Jul 7, 2021 at 11:34 PM Nicholas Spain <
[email protected]> wrote:

>
> Hi,
>
> At work I've extended the MySQL2 adapter to allow renaming multiple tables
> in a single statement:
> https://github.com/nick96/sequel/commit/a0d6c37c23d9ef125b5acaf1d6c6b4271a97db36
> .
>
> I'd like to contribute this back but wanted to check in before submitting
> a PR as the guidelines request not submitting until the code is ready to be
> merged. I think this feature could be implemented for some of the other
> adapters but would require creating a transaction (e.g. Postgres would
> require multiple ALTER TABLE ... RENAME TO ... statements) which could be
> surprising as it is papering over the DBMS not having that feature. What is
> your preference for handling these types of cases?
>

I think for now it is fine to add it only for MySQL (seems kind of niche
use case anyway). Your commit looks mostly good, except that instead of
modifying the mysql and mysql2 adapters, you should modify the mysql shared
adapter (lib/sequel/adapters/shared/mysql.rb).  That way the support is
available on any adapter that connects to MySQL, such as the jdbc/mysql
adapter.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/CADGZSSc0q-pHTL%2B%2BOosrLeH2M5KQOH2UxCX6Tt4e__p%3Df%3DSy-Q%40mail.gmail.com.

Reply via email to