use Data::Dumper;
use SQL::Translator::Schema::Constants;
use SQL::Translator::Utils qw(debug header_comment);
-use SQL::Translator::Shim;
+use SQL::Translator::ProducerUtils;
-my $shim = SQL::Translator::Shim->new( quote_chars => ['[', ']'] );
+my $util = SQL::Translator::ProducerUtils->new( quote_chars => ['[', ']'] );
my %translate = (
date => 'datetime',
}
# -------------------------------------------------------------------
-sub unreserve { $shim->quote($_[0]) }
+sub unreserve { $util->quote($_[0]) }
1;
-package SQL::Translator::Shim;
+package SQL::Translator::ProducerUtils;
use Moo;
use Sub::Quote 'quote_sub';
--- /dev/null
+use strict;
+use warnings;
+
+use Test::More;
+
+use SQL::Translator::ProducerUtils;
+
+my $util = SQL::Translator::ProducerUtils->new(
+ quote_chars => ['[', ']'],
+);
+
+is $util->quote('frew'), '[frew]', 'simple quote works';
+is $util->quote('people.frew'), '[people].[frew]', 'namespaced quote works';
+
+my $single_util = SQL::Translator::ProducerUtils->new(
+ quote_chars => q(|),
+);
+
+is $single_util->quote('frew'), '|frew|', 'simple single quote works';
+is $single_util->quote('people.frew'), '|people|.|frew|', 'namespaced single quote works';
+
+my $no_util = SQL::Translator::ProducerUtils->new();
+
+is $no_util->quote('frew'), 'frew', 'simple no quote works';
+is $no_util->quote('people.frew'), 'people.frew', 'namespaced no quote works';
+
+done_testing;
+++ /dev/null
-use strict;
-use warnings;
-
-use Test::More;
-
-use SQL::Translator::Shim;
-
-my $shim = SQL::Translator::Shim->new(
- quote_chars => ['[', ']'],
-);
-
-is $shim->quote('frew'), '[frew]', 'simple quote works';
-is $shim->quote('people.frew'), '[people].[frew]', 'namespaced quote works';
-
-my $single_shim = SQL::Translator::Shim->new(
- quote_chars => q(|),
-);
-
-is $single_shim->quote('frew'), '|frew|', 'simple single quote works';
-is $single_shim->quote('people.frew'), '|people|.|frew|', 'namespaced single quote works';
-
-my $no_shim = SQL::Translator::Shim->new();
-
-is $no_shim->quote('frew'), 'frew', 'simple no quote works';
-is $no_shim->quote('people.frew'), 'people.frew', 'namespaced no quote works';
-
-done_testing;