0.0.162 • Published 5 years ago

sql-mvc v0.0.162

Weekly downloads
367
License
AGPL3 or commerci...
Repository
github
Last release
5 years ago

SQL-MVC

Paradigm inversion - write web applications in SQL instead of JavaScript.

If like me, you find the way web app development is done today as tedious, and wasteful, then join me in creating a true "application programming language" (or DSL of you prefer), as opposed to using a general purpose language (JavaScript) for writing applications.

In 1991 Oracle added a few extensions to SQL to create Procedural SQL, so now I have added a few more extensions to SQL, to create QUery Application Language Extensions (QUALE) - it is that simple.

Recent change log: Added My-SQL and MS-SQL drivers. Updated Node version- caused a lot of breakage.

Feedback

NPM shows thousands of weekly downloads, but I have not yet had feedback from the community, so please if you have any questions, comments or even just want to say hi, please drop me a email for a personal response via npm-support@sql-mvc.com

Alpha version 0.0 Notice: When evaluating SQL-MVC keep in mind this project is still version 0.0.x- alpha/preview release. A lot of stuff is not 100% polished or even to spec, try and pick up the key points we are trying to demonstrate not shortcomings or bugs (although all feedback is welcome).

Example

Live Demo at todomvc.sql-mvc.com This is a complete implementation of todomvc.com functionality in 40 lines of code.

<#model
CREATE TABLE TODO_MVC				--:{as:"Table"} 
(
  REF VARCHAR(40),					--:{as:"pk"}
  NAME VARCHAR(100),				--:{as:"Text",size:40,title:"todo",onupdate:"owner=session.id"}  
  OWNER VARCHAR(40),				--:{Type:"Hide"}
  STATUS VARCHAR(10) default ''    	--:{Type:"Pick",List:"Ticked",onupdate:"owner=session.id"}  
);#>

<#controller(todo.clear.button)
button(title:"Clear Completed",if:"(select count(ref) from todo_mvc where owner=session.id and status='1')!=0" )
sql update todo_mvc set status='3' where owner=session.id and (status='1');#>

<#controller(todo.itemcount)
ifquery ((select count(ref) from todo_mvc where owner=session.id and (status='' or status is null))!=1)
print () ($select count(*) from todo_mvc where owner=session.id and (status='' or status is null) $) items left
elsequery
print () ($select count(*) from todo_mvc where owner=session.id and (status='' or status is null) $) item left
endquery#>

<#view
table()
	Select  --:{Title:"Make new records",from:TODO_MVC,autoinsert:top,tablestyle:Todo}
	STATUS, --:{Action:Edit,debug:0,autosave:yes}
	NAME,   --:{Action:Edit,placeholder:"What needs to be done (tab to save)",autosave:yes}
	REF	    --:{Action:View,Type:Hide}
	From TODO_MVC 
	where (owner=session.id and ( (here.todo_type='' and (status!='3' or status is null)) 
	or( (status='' or status is null) and here.todo_type='1')or(status='1' and here.todo_type='2')))

use(todo.itemcount)

button(title:"View all") set here.todo_type='';

button(title:"Active")   set here.todo_type='1';

button(title:"Completed") set here.todo_type='2';

use(todo.clear.button)
#>

SQL-MVC Getting_Started,

  • Install instructions for Linux VPS from scratch - Install.md

The following may be broken as of June 2018 due to node changes.

Tutorials at :

Tutorials.md

Programmers Manual at :

Github - wiki

Developer Resources

Supported SQL engines

  • Firebird Version 2.5
  • MYSQL Version 5.7
  • MSSQL SQL SERVER 12
  • Soon - Postgres
  • Soon - Oracle
  • Soon - NuoDB

How does SQL-MVC work?

  • The compiler takes your application code which is little more than a few SQL statements, directives and properties and produces:
    1. All the database code as a single stored procedure, to be run to produce JSON output.
    2. a Moustache Template(Hogan) containing all the client side code to be filled with the JSON. When the two are combined in the browser.
  • The server node.js does very little other than pass JSON between the server and client.
  • All the business logic remains in the database server.
  • You have full control of the client side look, feel and behaviour, the default framework and theme is just to give you a quick start.

Super fast Development:

  • Write web applications with little more than a few SQL statements
  • DRY (don't repeat yourself), Inheritance, Auto-Menus and more further reduces development time.
  • Drop-in and plug-in modules allow easy use and customisation of common application functionality.
  • Quick start with Platform + Framework + Themes + Modules + Demo's
  • Build easily reusable custom widgets from complex HTML/JS/JQ
  • Consistently customise the look and feel of your application widgets.
  • Automatic hot code push during development (no reloading of pages with F5)
  • i18n support and tools
  • Security implied by design rather than explicit configuration.

Super fast Runtime:

  • All database queries are amalgamated into a single database stored procedure call.
  • the JSON from the database is retrieved in one BLOB (Less chatter to the DB).
  • Almost no middle-ware processing.
  • Exchange only JSON data elements across the wire.
  • Build with Nodejs, SocketStream and Hogan templates to produce Single Page Applications.
  • Cache client side code automatically, and update automatically when the server side changes.
  • The page loads full visible content on first load - no partial view like waiting for multiple Ajax /ReST calls.
  • Lazy loading of application client code while the user keys in his login information( if not cached already).
  • Partial div(Divout) / records load/reload on Navigating / Saving or refreshing content.
  • Lazy loading of obscured views or obscured rows in large data sets
  • Client side caching of large datasets in reusable/relocatable chunks
  • Subscribe to events to do partial refreshes when changes are posted to database objects by other users.

Other features

  • Windows installer and development environment with JIT compiler and notepad++ with syntax highlighting.
  • Database drivers available for Firebird SQL, support planned for : MySQL, SQL Server, Oracle, NuoDB.
  • Planned support for JavaScript stored procedure engine, to enable no-sql, sqlite and off-line applications.

Licensing

QualeQuest/SQL-MVC is a Dual-licensed, either under the AGPL 3 license, or for a fee, you can license under a commercial-friendly license, which lets you embed, modify, and redistribute QualeQuest/SQL-MVC with your commercial application, without having to open source your application.

0.0.162

5 years ago

0.0.161

5 years ago

0.0.160

5 years ago

0.0.157

6 years ago

0.0.156

6 years ago

0.0.155

6 years ago

0.0.154

6 years ago

0.0.153

6 years ago

0.0.152

6 years ago

0.0.151

6 years ago

0.0.150

6 years ago

0.0.149

6 years ago

0.0.148

6 years ago

0.0.147

6 years ago

0.0.146

6 years ago

0.0.145

6 years ago

0.0.144

6 years ago

0.0.143

6 years ago

0.0.142

6 years ago

0.0.141

6 years ago

0.0.140

6 years ago

0.0.139

6 years ago

0.0.138

6 years ago

0.0.137

6 years ago

0.0.136

6 years ago

0.0.135

6 years ago

0.0.134

6 years ago

0.0.133

6 years ago

0.0.132

6 years ago

0.0.131

6 years ago

0.0.130

6 years ago

0.0.129

6 years ago

0.0.128

6 years ago

0.0.127

6 years ago

0.0.126

7 years ago

0.0.125

9 years ago

0.0.124

9 years ago

0.0.123

9 years ago

0.0.122

9 years ago

0.0.120

9 years ago

0.0.118

9 years ago

0.0.117

9 years ago

0.0.116

9 years ago

0.0.115

9 years ago

0.0.114

9 years ago

0.0.113

9 years ago

0.0.112

9 years ago

0.0.109

9 years ago

0.0.108

9 years ago

0.0.107

9 years ago

0.0.106

9 years ago

0.0.105

9 years ago

0.0.104

9 years ago

0.0.103

9 years ago

0.0.102

9 years ago

0.0.101

9 years ago

0.0.100

9 years ago

0.0.99

9 years ago

0.0.98

9 years ago

0.0.97

9 years ago

0.0.96

9 years ago

0.0.95

9 years ago

0.0.94

9 years ago

0.0.93

9 years ago

0.0.91

9 years ago

0.0.90

9 years ago

0.0.89

9 years ago

0.0.88

9 years ago

0.0.87

9 years ago

0.0.86

9 years ago

0.0.85

9 years ago

0.0.84

9 years ago

0.0.83

9 years ago

0.0.82

9 years ago

0.0.81

9 years ago

0.0.80

9 years ago

0.0.78

9 years ago

0.0.77

9 years ago

0.0.76

9 years ago

0.0.75

9 years ago

0.0.74

9 years ago

0.0.73

9 years ago

0.0.72

9 years ago

0.0.71

9 years ago

0.0.70

9 years ago

0.0.69

9 years ago

0.0.68

9 years ago

0.0.67

9 years ago

0.0.64

9 years ago

0.0.63

9 years ago

0.0.62

9 years ago

0.0.61

9 years ago

0.0.60

9 years ago

0.0.59

9 years ago

0.0.58

9 years ago

0.0.56

9 years ago

0.0.55

9 years ago

0.0.54

9 years ago

0.0.53

9 years ago

0.0.52

9 years ago

0.0.51

9 years ago

0.0.50

9 years ago

0.0.49

9 years ago

0.0.48

9 years ago

0.0.47

9 years ago

0.0.46

9 years ago

0.0.44

9 years ago

0.0.43

9 years ago

0.0.42

9 years ago

0.0.41

9 years ago

0.0.39

9 years ago

0.0.38

9 years ago

0.0.37

9 years ago

0.0.36

9 years ago

0.0.35

9 years ago

0.0.34

9 years ago

0.0.33

9 years ago

0.0.32

9 years ago

0.0.31

9 years ago

0.0.30

9 years ago

0.0.29

9 years ago

0.0.28

9 years ago

0.0.27

9 years ago

0.0.26

9 years ago

0.0.25

9 years ago

0.0.24

9 years ago

0.0.23

9 years ago

0.0.22

9 years ago

0.0.21

9 years ago

0.0.20

9 years ago

0.0.19

9 years ago

0.0.18

9 years ago

0.0.17

9 years ago

0.0.16

9 years ago

0.0.15

9 years ago

0.0.14

9 years ago

0.0.12

9 years ago

0.0.11

9 years ago

0.0.10

9 years ago

0.0.9

9 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago