0

How Can I create a COPY function in the .xml mapper with myBatis? And what values this function will return? I think it is as

<copy id="copyFunction">
    COPY (SELECT * FROM #{table_name} WHERE backup = 1) TO 'C:\var\audiobays\logs\audit\' || #{table_name} || '_deletions_(' || now()::DATE || '-' || days || ').csv'' CSV DELIMITER '','' HEADER;'
</copy>

But I'm not sure that it is what.
Can someone help me? Thank you!

1 Answers1

1

You can't as mybatis does not implement support for copy.

COPY is postgresql specific command and it is not supported in JDBC. To use it postgresql specific classes like CopyManager are needed.

mybatis uses JDBC to access database and does not provide support for non standard features like this.