Skip to content

fangwd/sqlex-keywords

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Check if a string is a reserved SQL keyword for SQLite, MySQL, PostgreSQL, Oracle and SQL Server.

Syntax

isReserved(keyword: string, dialect?: 'sqlite3' | 'mysql' | 'postgres' | 'mssql' | 'oracle')

Usage

import { isReserved } from 'sqlex-keywords';

expect(isReserved('FILE')).toBe(true);
expect(isReserved('FILE', 'sqlite')).toBe(false);
expect(isReserved('FILE', 'mysql')).toBe(false);
expect(isReserved('FILE', 'postgres')).toBe(false);
expect(isReserved('FILE', 'oracle')).toBe(true);
expect(isReserved('FILE', 'mssql')).toBe(true);

References

[1] https://en.wikipedia.org/wiki/SQL_reserved_words [2] https://www.sqlite.org/lang_keywords.html

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published