8000 GitHub - achrafl0/jsqx: Cursed lib to make SQL Queries in JSX (dont use this)
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

achrafl0/jsqx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSQX

image

A cursed librairy to create SQL queries using JSX

License

YOU CAN ONLY USE THIS LIBRAIRY IN PURELY COMMERCIAL PROJECTS. I want to see this in prod (for legal reasons this is a joke, you can use this whatever you want, just you know, a bit of credit would be nice)

USAGE

const query = (
  <Select table="Users" columns={["*"]} alias="u">
    <Where>
      <Clause clause={`u.id = ${author.id}`} />
      <Clause clause={`u.isAdmin = ${author.isAdmin}`} />
    </Where>
    <Sort column="createdAt" order="asc" />
    <Limit value={100} />
  </Select>
);

// With TypeORM
const rawData = await manager.query(query);

// With Prisma

const result = await prisma.$queryRaw(
  Prisma.sql`${query}`
)

## Testing

Didn't test, don't care, don't @ me

TODO

  • Support UPDATE
  • Support DELETE
  • Support INSERT
  • Support Transactions (that's gonna be fun)

About

Cursed lib to make SQL Queries in JSX (dont use this)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
0