Open
Description
What is the suggestion?
- As a user of this library, I think a great enhancement would be to support usage of capitalized SQL keywords
Why?
- Alternative way of writing SQL queries; some people think it's more readable & it's easy to quicly identify that this is SQL code.
- Lots of SQL users fall into two camps (lol 😎) the ones who write queries in either of these two ways:
SQL & Javascript snippet examples below:
Javascript Example
import { query } from 'sqliterally';
/************ 1. Non capitalized *************/
let q = query
.select` id, username`.from`Users`.where`name = 'Anna'`
let q = query
.select`
id,
username`
.from`
Users`
.where`name = 'Anna';
/************ 2. Capitalized *************/
let q = query
.SELECT` id, username`.FROM`Users`.WHERE`name = 'Anna'`
let q = query
.SELECT`
id,
username`
.FROM`
Users`
.WHERE`name = 'Anna';
Raw SQL Example for putting this into context
1. Non capitalized
select id, username from Users WHERE name = 'Anna'
select
id,
username
from
Users
where name = 'Anna'
-------------------------------------------
2. Capitalized
SELECT id, username FROM Users WHERE name = 'Anna'
SELECT
id,
username
FROM
Users
WHERE name = 'Anna'