From 6e599a0a53bb9c7cdcfc183faabbcbd6053e8ba1 Mon Sep 17 00:00:00 2001 From: sake92 Date: Wed, 4 Sep 2024 10:56:45 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20sake92/s?= =?UTF-8?q?query@22ab9572b106788584844ea147b19502a2e8700c=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tutorials/code-gen.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tutorials/code-gen.html b/tutorials/code-gen.html index cb4d0c3..aea563e 100644 --- a/tutorials/code-gen.html +++ b/tutorials/code-gen.html @@ -32,7 +32,7 @@ padding-left: 3em; font-size: .8em; } -

Code generator

Squery has a standalone code generator that can generate code for various databases:
+

Code generator

Squery has a code generator that can generate code for various databases:
Postgres, MySQL, MariaDB, Oracle and H2.

It generates models for table rows and handy DAO code with various utility methods:

    @@ -41,6 +41,10 @@
  • insert, updateById
  • deleteWhere, deleteById, deleteIds
+

Squery codegene is a bit special since it is using Regenesca library.
+When you add a new column for example, it will refactor the *Row and *Dao code in place!
+This means you can add your own methods/vals to the generated code, without fear that the codegen will remove it.
+Of course, it is best to use scalafmt after codegen so that the diff is minimal.

Standalone generator

You can use Ammonite to test the generator:

import $ivy.`ba.sake:squery-generator_2.13:0.6.0`
 import $ivy.`ba.sake::squery:0.6.0`