Use Manifold SQL simply by adding the javac -Xplugin:Manifold argument and manifold-sql and manifold-sql-rt dependencies to your gradle or maven build

Search code, repositories, users, issues, pull requests...

submited by
Style Pass
2024-10-08 05:30:06

Use Manifold SQL simply by adding the javac -Xplugin:Manifold argument and manifold-sql and manifold-sql-rt dependencies to your gradle or maven build. See Step 1. Add Manifold SQL to your build.

You can inline SQL queries and commands in both standard String Literals and Text Blocks. This query demonstrates how you can use native SQL to produce result sets of any type.

Query results consist of entity instances and/or row instances, depending on whether all required columns are selected. As such, select * queries conveniently result in entity instances.

This query also demonstrates the use of type-safe, injection-safe query parameters. Parameters are supported in all SQL commands including Insert, Update, Delete as well as Select.

Here the Payments query type is defined and used in the same local scope. Notice the type declaration, Payments.sql follows the file name.extension convention. The type name is Payments and the type domain is sql.

With IntelliJ you can interactively execute parameterized SQL queries in your code directly against test data, analyze query execution plans, and a lot more.

Leave a Comment