--- /dev/null
+package Data::Query::Renderer::SQL::MySQL;
+
+use Moo;
+
+extends 'Data::Query::Renderer::SQL::Naive';
+
+with 'Data::Query::Renderer::SQL::Slice::LimitXY';
+
+sub _insert_default_values {
+ my ($self) = @_;
+ $self->_format_keyword('VALUES'), qw( ( ) );
+}
+
+1;
($names
? ('(', intersperse(',', map $self->_render($_), @$names), ')')
: ()),
- $self->_format_keyword('VALUES'),
- intersperse(',',
- map [ '(', intersperse(',', map $self->_render($_), @$_), ')' ],
- @$values
- ),
+ (@$values && @{$values->[0]}
+ ? ($self->_format_keyword('VALUES'),
+ intersperse(',',
+ map [ '(', intersperse(',', map $self->_render($_), @$_), ')' ],
+ @$values
+ ))
+ : ($self->_insert_default_values)),
($returning
? ($self->_format_keyword('RETURNING'),
intersperse(',', map $self->_render($_), @$returning))
];
}
+sub _insert_default_values {
+ my ($self) = @_;
+ $self->_format_keyword('DEFAULT VALUES'),
+}
+
1;