Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotchance committed Dec 27, 2024
1 parent 2264075 commit 16a0024
Show file tree
Hide file tree
Showing 74 changed files with 4,125 additions and 1,586 deletions.
4,109 changes: 4,073 additions & 36 deletions docs/v-client-library-docs.rst

Large diffs are not rendered by default.

19 changes: 0 additions & 19 deletions vsql/std_10_10_sort_specification_list.v
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,7 @@ module vsql

// ISO/IEC 9075-2:2016(E), 10.10, <sort specification list>
//
// # Function
//
// Specify a sort order.
//
// # Format
//~
//~ <sort specification list> /* []SortSpecification */ ::=
//~ <sort specification> -> sort_list_1
//~ | <sort specification list> <comma> <sort specification> -> sort_list_2
//~
//~ <sort specification> /* SortSpecification */ ::=
//~ <sort key> -> sort_1
//~ | <sort key> <ordering specification> -> sort_2
//~
//~ <sort key> /* ValueExpression */ ::=
//~ <value expression>
//~
//~ <ordering specification> /* bool */ ::=
//~ ASC -> yes
//~ | DESC -> no

struct SortSpecification {
expr ValueExpression
Expand Down
19 changes: 0 additions & 19 deletions vsql/std_10_4_routine_invocation.v
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,7 @@ module vsql

// ISO/IEC 9075-2:2016(E), 10.4, <routine invocation>
//
// # Function
//
// Invoke an SQL-invoked routine.
//
// # Format
//~
//~ <routine invocation> /* RoutineInvocation */ ::=
//~ <routine name> <SQL argument list> -> routine_invocation
//~
//~ <routine name> /* Identifier */ ::=
//~ <qualified identifier> -> routine_name
//~
//~ <SQL argument list> /* []ValueExpression */ ::=
//~ <left paren> <right paren> -> sql_argument_list_1
//~ | <left paren> <SQL argument> <right paren> -> sql_argument_list_2
//~ | <left paren> <SQL argument list> <comma>
//~ <SQL argument> <right paren> -> sql_argument_list_3
//~
//~ <SQL argument> /* ValueExpression */ ::=
//~ <value expression>

struct RoutineInvocation {
function_name string
Expand Down
22 changes: 0 additions & 22 deletions vsql/std_10_9_aggregate_function.v
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,7 @@ module vsql

// ISO/IEC 9075-2:2016(E), 10.9, <aggregate function>
//
// # Function
//
// Specify a value computed from a collection of rows.
//
// # Format
//~
//~ <aggregate function> /* AggregateFunction */ ::=
//~ COUNT <left paren> <asterisk> <right paren> -> count_all
//~ | <general set function>
//~
//~ <general set function> /* AggregateFunction */ ::=
//~ <set function type> <left paren>
//~ <value expression> <right paren> -> general_set_function
//~
//~ <set function type> /* string */ ::=
//~ <computational operation>
//~
//~ <computational operation> /* string */ ::=
//~ AVG
//~ | MAX
//~ | MIN
//~ | SUM
//~ | COUNT

type AggregateFunction = AggregateFunctionCount | RoutineInvocation

Expand Down
10 changes: 0 additions & 10 deletions vsql/std_11_1_schema_definition.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,7 @@ import time

// ISO/IEC 9075-2:2016(E), 11.1, <schema definition>
//
// # Function
//
// Define a schema.
//
// # Format
//~
//~ <schema definition> /* Stmt */ ::=
//~ CREATE SCHEMA <schema name clause> -> schema_definition
//~
//~ <schema name clause> /* Identifier */ ::=
//~ <schema name>

struct SchemaDefinition {
schema_name Identifier
Expand Down
11 changes: 0 additions & 11 deletions vsql/std_11_2_drop_schema_statement.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,7 @@ import time

// ISO/IEC 9075-2:2016(E), 11.2, <drop schema statement>
//
// # Function
//
// Destroy a schema.
//
// # Format
//~
//~ <drop schema statement> /* Stmt */ ::=
//~ DROP SCHEMA <schema name> <drop behavior> -> drop_schema_statement
//~
//~ <drop behavior> /* string */ ::=
//~ CASCADE
//~ | RESTRICT

struct DropSchemaStatement {
schema_name Identifier
Expand Down
7 changes: 0 additions & 7 deletions vsql/std_11_31_drop_table_statement.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@ import time

// ISO/IEC 9075-2:2016(E), 11.31, <drop table statement>
//
// # Function
//
// Destroy a table.
//
// # Format
//~
//~ <drop table statement> /* Stmt */ ::=
//~ DROP TABLE <table name> -> drop_table_statement

struct DropTableStatement {
table_name Identifier
Expand Down
25 changes: 0 additions & 25 deletions vsql/std_11_3_table_definition.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,8 @@ import time

// ISO/IEC 9075-2:2016(E), 11.3, <table definition>
//
// # Function
//
// Define a persistent base table, a created local temporary table, or a global
// temporary table.
//
// # Format
//~
//~ <table definition> /* TableDefinition */ ::=
//~ CREATE TABLE <table name> <table contents source> -> table_definition
//~
//~ <table contents source> /* []TableElement */ ::=
//~ <table element list>
//~
//~ <table element list> /* []TableElement */ ::=
//~ <left paren>
//~ <table elements>
//~ <right paren> -> table_element_list
//~
//~ <table element> /* TableElement */ ::=
//~ <column definition>
//~ | <table constraint definition>
//
// These are non-standard, just to simplify standard rules:
//~
//~ <table elements> /* []TableElement */ ::=
//~ <table element> -> table_elements_1
//~ | <table elements> <comma> <table element> -> table_elements_2

type TableElement = Column | UniqueConstraintDefinition

Expand Down
23 changes: 0 additions & 23 deletions vsql/std_11_4_column_definition.v

This file was deleted.

4 changes: 4 additions & 0 deletions vsql/std_11_4_column_definition.y
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
%%

// ISO/IEC 9075-2:2016(E), 11.4, <column definition>
//
// Define a column of a base table.

column_definition:
column_name data_type_or_domain_name {
$$.v = TableElement(Column{$1.v as Identifier, $2.v as Type, false})
Expand Down
15 changes: 0 additions & 15 deletions vsql/std_11_6_table_constraint_definition.v

This file was deleted.

4 changes: 4 additions & 0 deletions vsql/std_11_6_table_constraint_definition.y
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
%%

// ISO/IEC 9075-2:2016(E), 11.6, <table constraint definition>
//
// Specify an integrity constraint.

table_constraint_definition:
table_constraint { $$.v = $1.v as TableElement }

Expand Down
66 changes: 0 additions & 66 deletions vsql/std_11_72_sequence_generator_definition.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,73 +4,7 @@ import time

// ISO/IEC 9075-2:2016(E), 11.72, <sequence generator definition>
//
// # Function
//
// Define an external sequence generator.
//
// # Format
//~
//~ <sequence generator definition> /* Stmt */ ::=
//~ CREATE SEQUENCE
//~ <sequence generator name> -> sequence_generator_definition_1
//~ | CREATE SEQUENCE <sequence generator name>
//~ <sequence generator options> -> sequence_generator_definition_2
//~
//~ <sequence generator options> /* []SequenceGeneratorOption */ ::=
//~ <sequence generator option>
//~ | <sequence generator options> <sequence generator option>
//~
//~ <sequence generator option> /* []SequenceGeneratorOption */ ::=
//~ <common sequence generator options>
//~
//~ <common sequence generator options> /* []SequenceGeneratorOption */ ::=
//~ <common sequence generator option> -> sequence_generator_options_1
//~ | <common sequence generator options>
//~ <common sequence generator option> -> sequence_generator_options_2
//~
//~ <common sequence generator option> /* SequenceGeneratorOption */ ::=
//~ <sequence generator start with option> -> SequenceGeneratorOption
//~ | <basic sequence generator option>
//~
//~ <basic sequence generator option> /* SequenceGeneratorOption */ ::=
//~ <sequence generator increment by option> -> SequenceGeneratorOption
//~ | <sequence generator maxvalue option> -> SequenceGeneratorOption
//~ | <sequence generator minvalue option> -> SequenceGeneratorOption
//~ | <sequence generator cycle option> -> basic_sequence_generator_option_4
//~
//~ <sequence generator start with option> /* SequenceGeneratorStartWithOption */ ::=
//~ START WITH
//~ <sequence generator start value> -> sequence_generator_start_with_option
//~
//~ <sequence generator start value> /* Value */ ::=
//~ <signed numeric literal>
//~
//~ <sequence generator increment by option> /* SequenceGeneratorIncrementByOption */ ::=
//~ INCREMENT BY
//~ <sequence generator increment> -> sequence_generator_increment_by_option
//~
//~ <sequence generator increment> /* Value */ ::=
//~ <signed numeric literal>
//~
//~ <sequence generator maxvalue option> /* SequenceGeneratorMaxvalueOption */ ::=
//~ MAXVALUE
//~ <sequence generator max value> -> sequence_generator_maxvalue_option_1
//~ | NO MAXVALUE -> sequence_generator_maxvalue_option_2
//~
//~ <sequence generator max value> /* Value */ ::=
//~ <signed numeric literal>
//~
//~ <sequence generator minvalue option> /* SequenceGeneratorMinvalueOption */ ::=
//~ MINVALUE
//~ <sequence generator min value> -> sequence_generator_minvalue_option_1
//~ | NO MINVALUE -> sequence_generator_minvalue_option_2
//~
//~ <sequence generator min value> /* Value */ ::=
//~ <signed numeric literal>
//~
//~ <sequence generator cycle option> /* bool */ ::=
//~ CYCLE -> yes
//~ | NO CYCLE -> no

type SequenceGeneratorOption = SequenceGeneratorCycleOption
| SequenceGeneratorIncrementByOption
Expand Down
26 changes: 0 additions & 26 deletions vsql/std_11_73_alter_sequence_generator_statement.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,7 @@ import time

// ISO/IEC 9075-2:2016(E), 11.73, <alter sequence generator statement>
//
// # Function
//
// Change the definition of an external sequence generator.
//
// # Format
//~
//~ <alter sequence generator statement> /* AlterSequenceGeneratorStatement */ ::=
//~ ALTER SEQUENCE
//~ <sequence generator name>
//~ <alter sequence generator options> -> alter_sequence_generator_statement
//~
//~ <alter sequence generator options> /* []SequenceGeneratorOption */ ::=
//~ <alter sequence generator option> -> sequence_generator_options_1
//~ | <alter sequence generator options>
//~ <alter sequence generator option> -> sequence_generator_options_2
//~
//~ <alter sequence generator option> /* SequenceGeneratorOption */ ::=
//~ <alter sequence generator restart option> -> SequenceGeneratorOption
//~ | <basic sequence generator option>
//~
//~ <alter sequence generator restart option> /* SequenceGeneratorRestartOption */ ::=
//~ RESTART -> sequence_generator_restart_option_1
//~ | RESTART WITH
//~ <sequence generator restart value> -> sequence_generator_restart_option_2
//~
//~ <sequence generator restart value> /* Value */ ::=
//~ <signed numeric literal>

struct AlterSequenceGeneratorStatement {
name Identifier
Expand Down
8 changes: 0 additions & 8 deletions vsql/std_11_74_drop_sequence_generator_statement.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,7 @@ import time

// ISO/IEC 9075-2:2016(E), 11.74, <drop sequence generator statement>
//
// # Function
//
// Destroy an external sequence generator.
//
// # Format
//~
//~ <drop sequence generator statement> /* Stmt */ ::=
//~ DROP SEQUENCE
//~ <sequence generator name> -> drop_sequence_generator_statement

struct DropSequenceGeneratorStatement {
sequence_name Identifier
Expand Down
14 changes: 0 additions & 14 deletions vsql/std_11_7_unique_constraint_definition.v
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,7 @@ module vsql

// ISO/IEC 9075-2:2016(E), 11.7, <unique constraint definition>
//
// # Function
//
// Specify a uniqueness constraint for a table.
//
// # Format
//~
//~ <unique constraint definition> /* TableElement */ ::=
//~ <unique specification> <left paren>
//~ <unique column list> <right paren> -> unique_constraint_definition
//~
//~ <unique specification> ::=
//~ PRIMARY KEY -> ignore
//~
//~ <unique column list> /* []Identifier */ ::=
//~ <column name list>

struct UniqueConstraintDefinition {
columns []Identifier
Expand Down
Loading

0 comments on commit 16a0024

Please sign in to comment.