Atomic update and backup ON DUPLICATE KEY golang sql statement [closed]











up vote
-1
down vote

favorite












What is the best way to combine two statements (INSERT or (BACKUP and UPDATE)) and perform them atomically in golang?



I found this similar question:
Query Select and Insert if not exists



But the Solution does there does not fulfil 2 of the the following requirements:




  1. perform an backup of the value ON DUPLICATE KEY,

  2. user standard SQL

  3. not use store procedures but

  4. remain atomic.










share|improve this question













closed as off-topic by Toby Speight, Heslacher, VisualMelon, Martin R, Mast Nov 20 at 14:27


This question appears to be off-topic. The users who voted to close gave these specific reasons:



  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – Toby Speight, Martin R, Mast

  • "Authorship of code: Since Code Review is a community where programmers improve their skills through peer review, we require that the code be posted by an author or maintainer of the code, that the code be embedded directly, and that the poster know why the code is written the way it is." – Heslacher, VisualMelon


If this question can be reworded to fit the rules in the help center, please edit the question.









  • 1




    Welcome on Code Review. Unfortunately, we don't provide code, we review code you've written. Depending on your problem, another site of the StackExchange network can help you. Please see our help center for more information.
    – Calak
    Nov 20 at 10:22















up vote
-1
down vote

favorite












What is the best way to combine two statements (INSERT or (BACKUP and UPDATE)) and perform them atomically in golang?



I found this similar question:
Query Select and Insert if not exists



But the Solution does there does not fulfil 2 of the the following requirements:




  1. perform an backup of the value ON DUPLICATE KEY,

  2. user standard SQL

  3. not use store procedures but

  4. remain atomic.










share|improve this question













closed as off-topic by Toby Speight, Heslacher, VisualMelon, Martin R, Mast Nov 20 at 14:27


This question appears to be off-topic. The users who voted to close gave these specific reasons:



  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – Toby Speight, Martin R, Mast

  • "Authorship of code: Since Code Review is a community where programmers improve their skills through peer review, we require that the code be posted by an author or maintainer of the code, that the code be embedded directly, and that the poster know why the code is written the way it is." – Heslacher, VisualMelon


If this question can be reworded to fit the rules in the help center, please edit the question.









  • 1




    Welcome on Code Review. Unfortunately, we don't provide code, we review code you've written. Depending on your problem, another site of the StackExchange network can help you. Please see our help center for more information.
    – Calak
    Nov 20 at 10:22













up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











What is the best way to combine two statements (INSERT or (BACKUP and UPDATE)) and perform them atomically in golang?



I found this similar question:
Query Select and Insert if not exists



But the Solution does there does not fulfil 2 of the the following requirements:




  1. perform an backup of the value ON DUPLICATE KEY,

  2. user standard SQL

  3. not use store procedures but

  4. remain atomic.










share|improve this question













What is the best way to combine two statements (INSERT or (BACKUP and UPDATE)) and perform them atomically in golang?



I found this similar question:
Query Select and Insert if not exists



But the Solution does there does not fulfil 2 of the the following requirements:




  1. perform an backup of the value ON DUPLICATE KEY,

  2. user standard SQL

  3. not use store procedures but

  4. remain atomic.







sql go






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 20 at 9:57









Macilias

1022




1022




closed as off-topic by Toby Speight, Heslacher, VisualMelon, Martin R, Mast Nov 20 at 14:27


This question appears to be off-topic. The users who voted to close gave these specific reasons:



  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – Toby Speight, Martin R, Mast

  • "Authorship of code: Since Code Review is a community where programmers improve their skills through peer review, we require that the code be posted by an author or maintainer of the code, that the code be embedded directly, and that the poster know why the code is written the way it is." – Heslacher, VisualMelon


If this question can be reworded to fit the rules in the help center, please edit the question.




closed as off-topic by Toby Speight, Heslacher, VisualMelon, Martin R, Mast Nov 20 at 14:27


This question appears to be off-topic. The users who voted to close gave these specific reasons:



  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – Toby Speight, Martin R, Mast

  • "Authorship of code: Since Code Review is a community where programmers improve their skills through peer review, we require that the code be posted by an author or maintainer of the code, that the code be embedded directly, and that the poster know why the code is written the way it is." – Heslacher, VisualMelon


If this question can be reworded to fit the rules in the help center, please edit the question.








  • 1




    Welcome on Code Review. Unfortunately, we don't provide code, we review code you've written. Depending on your problem, another site of the StackExchange network can help you. Please see our help center for more information.
    – Calak
    Nov 20 at 10:22














  • 1




    Welcome on Code Review. Unfortunately, we don't provide code, we review code you've written. Depending on your problem, another site of the StackExchange network can help you. Please see our help center for more information.
    – Calak
    Nov 20 at 10:22








1




1




Welcome on Code Review. Unfortunately, we don't provide code, we review code you've written. Depending on your problem, another site of the StackExchange network can help you. Please see our help center for more information.
– Calak
Nov 20 at 10:22




Welcome on Code Review. Unfortunately, we don't provide code, we review code you've written. Depending on your problem, another site of the StackExchange network can help you. Please see our help center for more information.
– Calak
Nov 20 at 10:22















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Сан-Квентин

Алькесар

Josef Freinademetz