Skip to content
This repository was archived by the owner on Jul 15, 2021. It is now read-only.

Commit 83587a4

Browse files
committed
Allow negative default value on text column.
SQLite allows a negative default value on an added text column.
1 parent 4852176 commit 83587a4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/grammar.pegjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,15 @@ literal_date "Date Literal"
217217
* @note
218218
* 1) [ENFORCED] SQL uses single quotes for string literals.
219219
* 2) [NOT IMPLEMENTED] Value is an identier or a string literal based on context.
220+
* 3) [IMPLEMENTED] SQLite allows a negative default value on an added text column.
220221
* {@link https://www.sqlite.org/lang_keywords.html}
221222
*/
222223
literal_string "String Literal"
223-
= s:( literal_string_single )
224+
= n:( number_sign )? s:( literal_string_single )
224225
{
225226
return {
226227
'type': 'literal',
227-
'variant': 'string',
228+
'variant': 'text',
228229
'value': s
229230
};
230231
}
@@ -256,8 +257,7 @@ literal_blob "Blob Literal"
256257
}
257258

258259
number_sign "Number Sign"
259-
= s:( sym_plus / sym_minus )
260-
{ return s; }
260+
= s:( sym_plus / sym_minus ) { return s; }
261261

262262
literal_number_signed
263263
= s:( number_sign )? n:( literal_number )

0 commit comments

Comments
 (0)