Commit Graph

145 Commits

Author SHA1 Message Date
Simon Binder 3000cb2e44
Parse FROM clauses for update statements 2021-03-13 12:02:35 +01:00
Hossein Yousefi c0fc691a94 view analyzer class added 2021-02-11 18:38:41 +01:00
Simon Binder 5ff74c7bcb
Improve table analysis, parse key ordering (#1007) 2021-01-18 14:44:05 +01:00
Simon Binder fa0cda6ffe
Add regression test for #978 2020-12-19 17:34:32 +01:00
Simon Binder 6aa022e547
Add nullability hints, generate nullable variables 2020-12-14 18:35:19 +01:00
Simon Binder 9025280a89
Migrate sqlparser to null safety 2020-12-11 10:53:17 +01:00
Simon Binder 0c075a2b44
Support overriding column getters and table classes (#932) 2020-11-23 20:01:31 +01:00
Simon Binder 1d7479226a
Parse NULL column constraints to fix parsing errors (#909) 2020-11-07 12:32:45 +01:00
Simon Binder 732369c25c
sqlparser: Give CASE a higher precedence 2020-10-22 13:30:43 +02:00
Simon Binder 2ae2388878
Support default values for Dart placeholders (#753) 2020-08-30 13:48:47 +02:00
Simon Binder 2897dd4ae0
Parse NULLS FIRST and NULLS LAST 2020-06-27 14:38:16 +02:00
Simon Binder 5136412573
Parse DEFERRABLE clauses on foreign key constraints 2020-06-27 14:26:09 +02:00
Simon Binder ccea0a5d36
Don't throw parsing errors for top-level statements 2020-06-24 17:08:13 +02:00
Simon Binder 5c6331e486
sqlparser: Make InsertSource an AstNode 2020-06-15 17:45:28 +02:00
Simon Binder 7ae3783473
sqlparser: Make TriggerTarget an ast node 2020-06-15 17:21:49 +02:00
Simon Binder 896d62d76c
Support nested CASE expressions (#609) 2020-06-02 12:05:02 +02:00
Simon Binder fee32fc302
Start with transformers in sqlparser 2020-05-24 22:30:25 +02:00
Simon Binder 8aca8db941
Merge branch 'views' of https://github.com/mqus/moor into mqus-views
# Conflicts:
#	sqlparser/test/analysis/schema/from_create_table_test.dart
2020-05-22 17:29:04 +02:00
Simon Binder 5d93f9fcf9
Analysis support for custom result sets 2020-05-21 15:22:49 +02:00
Simon Binder f7e7622b4c
Rename resultset.dart to result_set.dart, format parser test 2020-05-16 18:55:07 +02:00
Markus Richter 186153e585
Add parser test,advance analyzer,fix review issues
Also:
- Add toString method to Literal and alter the one on Reference to make debugging and analysing tests easier
- Add `@required` to columns in SelectStatement constructor to make it clear that it can't be null (required by childNodes getter)
2020-05-15 19:58:16 +02:00
Simon Binder 9841c960d1
Parse row values, warn on misuse 2020-05-06 21:08:47 +02:00
Simon Binder 6b2bd27d4d
Parse and analyze VALUES clause for selects 2020-04-16 22:41:21 +02:00
Simon Binder af5333db3c
Support compound select statements in from 2020-04-07 15:37:35 +02:00
Simon Binder d5ad3c6d34
Parse nested star columns 2020-04-03 18:37:33 +02:00
Simon Binder 1a2d3bdee7
Parse comma separated tables as proper join (#453) 2020-03-22 11:51:39 +01:00
Simon Binder d533a0a254
Fix error recovery on early finished statements #453 2020-03-21 22:02:27 +01:00
Simon Binder 814e7bf61d
SqlEngine: Migrate default construtor to options 2020-02-10 18:48:03 +01:00
Simon Binder 0c171c3b81
sqlparser: Support upsert clauses (#367) 2020-02-03 21:43:18 +01:00
Simon Binder fbe061c84d
Support current time literals in the sql parser 2020-02-01 13:18:53 +01:00
Simon Binder 223f1615ab
Support parsing table valued functions 2020-01-26 13:13:44 +01:00
Simon Binder ceb300e32e
Parse rowid as a valid expression in the sql parser 2020-01-26 12:23:47 +01:00
Simon Binder eb77d06cac
sqlparser: Recover from invalid column definitions 2020-01-18 15:09:42 +01:00
Simon Binder ddda6797e1
types: Analyze functions 2020-01-13 20:40:46 +01:00
Simon Binder a3708b7230
Remove deprecated usages of SqlEngine constructor 2020-01-07 11:40:43 +01:00
Simon Binder 282af57c78
Report a parsing error for invalid queries in moor files
We used to return null when the query didn't start with SELECT, INSERT, UPDATE or DELETE, which causes errors later on. Now, we don't accept the query and report a parsing error.
2020-01-04 17:06:45 +01:00
Simon Binder de67ca6e7b
Parse ISNULL and NOTNULL postfix expressions 2020-01-03 17:39:35 +01:00
Simon Binder 6924543a47
sqlparser: Parse CREATE INDEX statements 2020-01-03 17:14:42 +01:00
Simon Binder 04f75d11d3
Migrate some trigger code to refactorings on develop 2019-12-30 21:38:24 +01:00
Simon Binder ba603f22cc
Merge branch 'develop' into views-triggers-indexes
# Conflicts:
#	moor/lib/moor.dart
#	moor/lib/src/runtime/api/query_engine.dart
#	moor/lib/src/runtime/query_builder/schema/entities.dart
#	moor/test/data/tables/custom_tables.g.dart
#	moor/test/data/tables/tables.moor
#	moor/test/parsed_sql/moor_files_integration_test.dart
#	moor_generator/lib/src/analyzer/moor/parser.dart
#	moor_generator/lib/src/analyzer/runner/steps.dart
#	moor_generator/lib/src/analyzer/runner/steps/analyze_dart.dart
#	moor_generator/lib/src/model/specified_db_classes.dart
#	moor_generator/lib/src/writer/database_writer.dart
#	sqlparser/lib/src/ast/ast.dart
#	sqlparser/lib/src/ast/statements/create_table.dart
#	sqlparser/lib/src/ast/statements/statement.dart
#	sqlparser/lib/src/reader/parser/schema.dart
#	sqlparser/lib/src/reader/tokenizer/token.dart
#	sqlparser/test/engine/autocomplete/static_test.dart
2019-12-30 21:08:32 +01:00
Simon Binder c54a62120d
sqlparser: Support CAST expressions 2019-12-30 20:46:54 +01:00
Simon Binder 868dde358f
Parse variable type hints in queries 2019-12-25 20:24:03 +01:00
Simon Binder cb38590ee4
Parse special `@`-queries (not analyzed yet), #280 2019-12-17 22:03:59 +01:00
Simon Binder 3c74a20f56
Enable more recent lints and enforce them 2019-12-04 21:45:09 +01:00
Simon Binder f4c05f44c7
sqlparser: Read table schemas for fts5 tables 2019-12-04 19:55:23 +01:00
Simon Binder 325820af80
Parse CREATE VIRTUAL TABLE statements 2019-12-04 15:36:23 +01:00
Simon Binder a304d13927
Use enforceHasSpan on all parse results in tests 2019-10-27 11:51:09 +01:00
Simon Binder 29a7b4853d
Parse common table expressions (no analysis yet) 2019-10-21 22:10:19 +02:00
Simon Binder 8de2b141a9
Parse CREATE TRIGGER statements 2019-10-20 17:48:17 +02:00
Simon Binder 4c090af98c
Ability to override json keys in moor files (#176) 2019-10-14 19:59:52 +02:00
Simon Binder b684a7be69
Replace imports of test_api with test 2019-09-26 22:52:20 +02:00
Simon Binder 0cbac2ee37
Parse compound select statements 2019-09-25 14:58:44 +02:00
Simon Binder 1bdfa0289b
Make the parser set a span on each AST node. 2019-09-18 21:36:25 +02:00
Simon Binder 00b2956b35
Allow data class names to be overridden in sql
Closes #147
2019-09-17 15:23:24 +02:00
Simon Binder 746b8401ec
Scan comments in sql 2019-09-16 22:33:36 +02:00
Simon Binder 5f2d5d3258
Parse <expression> IN (<select-stmt>) again 2019-09-15 21:41:32 +02:00
Simon Binder 3abfbd5963
Don't parse tuples as expressions 2019-09-15 11:19:32 +02:00
Simon Binder f171098789
Parse Dart placeholders based on their context 2019-09-14 11:44:15 +02:00
Simon Binder 4c250c8f40
Parse dart template expressions and limit clauses 2019-09-13 23:08:29 +02:00
Simon Binder 44a2319bba
Improve variable tokenization for easier parsing logic 2019-09-13 22:48:55 +02:00
Simon Binder 35e5bdb317
Introduce new top-level ast node for moor files 2019-09-07 21:33:56 +02:00
Simon Binder 1ed1e3ba94
Parse declared statements in moor files 2019-09-07 20:26:51 +02:00
Simon Binder 6ccaad866b
Parse import statements in moor files 2019-09-05 10:52:33 +02:00
Simon Binder ba772ef07f
Better error handling when parsing multiple sql statements 2019-09-03 21:24:59 +02:00
Simon Binder 2f8dc6d68e
Parse insert statements 2019-08-29 15:04:39 +02:00
Simon Binder 5d2149d727
Parse MAPPED BY constraints for moor files 2019-08-27 12:33:48 +02:00
Simon Binder e911e74af2
Support window declarations on select statements 2019-08-19 18:06:25 +02:00
Simon Binder 1d3d68fb54
Parse aggregate functions and window definitions 2019-08-13 14:11:13 +02:00
Simon Binder 5df5e3cacc
Fix typename parsing, set span on default constraint 2019-07-30 09:35:19 +02:00
Simon Binder a550a49705
Export table structure from CREATE TABLE statements 2019-07-28 22:09:20 +02:00
Simon Binder 0bad842735
Parse table constraints 2019-07-28 21:01:48 +02:00
Simon Binder 7e0bfa9cf9
Parse foreign clauses as column constraints 2019-07-28 20:18:22 +02:00
Simon Binder 1766bb3f77
Fix tests that used "table" as a table name
(we now recognize that as a keyword)
2019-07-26 13:49:25 +02:00
Simon Binder dee9993c83
Parse CREATE TABLE statements 2019-07-26 13:35:49 +02:00
Simon Binder d01b5c750f
Fix order in limit expressions with comma
Fixes #73
2019-07-10 17:29:03 +02:00
Simon Binder aeb9b6ba41
Parse COLLATE expressions in the sql parser
For #67
2019-07-08 23:03:03 +02:00
Simon Binder b0ca66bc06
Parse empty tuples
Closes #54
2019-07-02 22:30:54 +02:00
Simon Binder 285113717f
Parse tuples 2019-07-02 12:48:08 +02:00
Simon Binder da07be2da4
Parse exists expressions 2019-07-01 14:27:08 +02:00
Simon Binder 791afdb6bf
Support ESCAPE clause for LIKE and similar expressions 2019-07-01 13:52:46 +02:00
Simon Binder baf3c9ce88
Parse update statements 2019-06-30 15:25:39 +02:00
Simon Binder 3f0776faf8
Fix tests, parse delete statements 2019-06-29 22:47:40 +02:00
Simon Binder ff530dd4ea
Improve documentation of the sqlparser library 2019-06-29 22:29:16 +02:00
Simon Binder 9c07eaa465
Parse case expressions 2019-06-29 17:59:18 +02:00
Simon Binder 7ef904d053
Parse between expressions 2019-06-29 17:32:06 +02:00
Simon Binder 674f4c6a9c
Slightly better reference resolving, parse subqueries 2019-06-26 21:44:29 +02:00
Simon Binder b0649ee208
Parse group by statements 2019-06-23 13:37:30 +02:00
Simon Binder 8bbf6d8054
Parse function expressions 2019-06-23 13:04:05 +02:00
Simon Binder 1c75c9d3e8
Parse sql variables 2019-06-23 11:50:44 +02:00
Simon Binder b52dcf9a60
Test select statement parsing 2019-06-23 10:35:25 +02:00
Simon Binder 5e6cabc816
Write some rudimentary api and docs for the parser 2019-06-22 22:35:34 +02:00
Simon Binder be5bcfd459
Parse "ORDER BY" clause 2019-06-18 14:49:30 +02:00
Simon Binder 1bc4bfc120
Simplify equality check, some more SELECT parsing 2019-06-17 22:33:28 +02:00
Simon Binder d125a844da
Start implementing SELECT statements for parser 2019-06-16 21:23:33 +02:00
Simon Binder b442d32a87
Parse simple expressions 2019-06-16 20:50:07 +02:00