0.2.1 • Published 3 years ago

spgen v0.2.1

Weekly downloads
6
License
ISC
Repository
-
Last release
3 years ago

spgen - A Stored Procedure Generater to write like JavaScript

Spgen is a tool for creating stored procedures like Javascript.


Example

// type.jssp
type IdentifierUser varchar(8);
// queries.jssp
query selectUser(userId) {
    select count(*) from user
    where user_id = :userId;
}
// import.jssp
import "./type.jssp"
import "./queries.jssp"

use test;

func demoimport(userId IdentifierUser) : int
{
    selectUser('primespace');

    return 0;
}
// generate stored procedure.
spgen generate import.jssp;
use test;

DELIMITER $$


DROP FUNCTION IF EXISTS demoimport;

CREATE FUNCTION demoimport(userId VARCHAR(8)) RETURNS INT
BEGIN

    select count(*) from user
    where user_id = 'primespace';

    return 0;
END 

$$

DELIMITER ;

Install

$ npm install -g spgen

spgen depends on Node.js and npm.

Usage

Usage: spgen <command>

where <command> is one of:
    generate, get, version

spgen generate sample.jssp [-out <path>]
    Converts the sample.jssp into the <path> directory

spgen get samples
    Copy all sample files to the current directory.

spgen version
    Output the version.
// Copy all sample files to the current directory.
$ spgen get samples

Generate stored procedure

// Converts the cursor.jssp into the output directory
$ spgen generate cursor.jssp -out ./output
0.2.1

3 years ago

0.2.0

3 years ago

0.1.51

3 years ago

0.1.50

4 years ago

0.1.40

4 years ago

0.1.39

4 years ago

0.1.38

4 years ago

0.1.37

4 years ago

0.1.36

6 years ago

0.1.35

7 years ago

0.1.34

7 years ago

0.1.33

7 years ago

0.1.31

7 years ago

0.1.30

7 years ago

0.1.29

7 years ago

0.1.28

7 years ago

0.1.27

7 years ago

0.1.26

7 years ago

0.1.25

7 years ago

0.1.24

7 years ago

0.1.23

7 years ago

0.1.22

7 years ago

0.1.21

7 years ago

0.1.20

7 years ago

0.1.19

7 years ago

0.1.18

7 years ago

0.1.17

7 years ago

0.1.16

7 years ago

0.1.15

7 years ago

0.1.14

7 years ago

0.1.13

7 years ago

0.1.12

7 years ago

0.1.11

7 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago