Skip to content

Latest commit

 

History

History
72 lines (52 loc) · 1.64 KB

File metadata and controls

72 lines (52 loc) · 1.64 KB

JtSQL

An interpreter implemented with .Net Core for JtSQL

About JtSQL

To-do

  • Hello World
  • Lexer
  • Parser
  • SQL Executor

How-to

Chakilo.JtSQL.Run(new Chakilo.Linq.Work("Your JtSQL code here"));

Differences from JtSQL-for-Java

  • Using placeholder in sql().

    $<SELECT * FROM `user` WHERE user_id > {{0}} AND user_id < {{Math.abs(5)}};>

    will be compiled into

    sql("SELECT * FROM `user` WHERE user_id > ? AND user_id < ?;", 0, Math.abs(5))
  • Semicolons may be omitted.

    Both

    for (;;) {
        if (condition) {
            var result = $<SELECT * FROM {{table}};>;
        };
    };

    and

    for (;;) {if (condition) {var result = $<SELECT * FROM {{table}}>}}

    are avaliable.

  • Inline comments supported.

    // get id by username
    var user_id = $<SELECT user_id FROM `user` WHERE username = {{username}} LIMIT 1;>

Examples

See also noear/JtSQL

Dependencies