create sql part joining control code
[scpubgit/Q-Branch.git] / lib / SQL / Abstract / Parts.pm
diff --git a/lib/SQL/Abstract/Parts.pm b/lib/SQL/Abstract/Parts.pm
new file mode 100644 (file)
index 0000000..95f7069
--- /dev/null
@@ -0,0 +1,19 @@
+package SQL::Abstract::Parts;
+
+use strict;
+use warnings;
+
+use overload '""' => 'stringify', fallback => 1;
+
+sub new {
+  my ($proto, @args) = @_;
+  bless(\@args, ref($proto) || $proto);
+}
+
+sub stringify {
+  my ($self) = @_;
+  my ($join, @parts) = @$self;
+  return join $join, @parts;
+}
+
+1;