--- /dev/null
+use strictures 1;
+use Test::More qw(no_plan);
+
+use Devel::Dwarn;
+use Data::Query::Renderer::SQL::Naive;
+use Data::Query::ExprHelpers;
+
+my $rend = Data::Query::Renderer::SQL::Naive->new({ quote_chars => [ "'" ] });
+
+sub binding { map perl_scalar_value($_), @_ }
+
+sub dq_sql_is {
+ my $expr = shift;
+#::Dwarn($expr); return;
+ my $rendered = $rend->render($expr);
+ is_deeply($rendered, @_);
+}
+
+dq_sql_is
+ Select([ Identifier('*') ], Identifier('foo')),
+ ['SELECT * FROM foo'],
+ 'simple select';
+
+dq_sql_is
+ Join(
+ Select([ Identifier('*') ], Identifier('foo')),
+ Identifier('bar'),
+ perl_operator('==', Identifier('foo', 'x'), Identifier('bar', 'y'))
+ ),
+ ['SELECT * FROM foo JOIN bar ON foo.x = bar.y'],
+ 'join on with dots';
+
+dq_sql_is
+ Where(
+ perl_operator(
+ '==',
+ Identifier('x'),
+ Literal('SQL', '?', [ binding(1) ],),
+ ),
+ Select([ Identifier('*') ], Identifier('foo')),
+ ),
+ ['SELECT * FROM foo WHERE x = ?', binding(1)],
+ 'simple select with where and bind';
+