Showing 9 changed files with 1232 additions and 215 deletions
+10
Changes
... ...
@@ -1,3 +1,13 @@
1
+0.1661
2
+    - added EXPERIMENTAL DBIx::Custom::Model table_alias attribute
3
+    - added EXPERIMENTAL DBIx::Custom::Model mycolumn()
4
+    - added EXPERIMENTAL DBIx::Custom::Model column()
5
+    - fixed autoloading bug
6
+    - added EXPERIMETNAL select() prepend table option
7
+    - added EXPERIMETNAL select() column table option
8
+    - added EXPERIMETNAL select() column all option
9
+    - removed EXPERIMETNAL select() all_column option
10
+    - removed EXPERIMENTAL view()
1 11
 0.1660
2 12
     - added EXPERIMENTAL DBIx::Custom::Model view()
3 13
     - added EXPERIMENTAL view()
+909
Makefile.old
... ...
@@ -0,0 +1,909 @@
1
+# This Makefile is for the DBIx::Custom extension to perl.
2
+#
3
+# It was generated automatically by MakeMaker version
4
+# 6.56 (Revision: 65600) from the contents of
5
+# Makefile.PL. Don't edit this file, edit Makefile.PL instead.
6
+#
7
+#       ANY CHANGES MADE HERE WILL BE LOST!
8
+#
9
+#   MakeMaker ARGV: ()
10
+#
11
+
12
+#   MakeMaker Parameters:
13
+
14
+#     ABSTRACT_FROM => q[lib/DBIx/Custom.pm]
15
+#     AUTHOR => q[Yuki Kimoto <kimoto.yuki@gmail.com>]
16
+#     BUILD_REQUIRES => {  }
17
+#     LICENSE => q[perl]
18
+#     NAME => q[DBIx::Custom]
19
+#     PL_FILES => {  }
20
+#     PREREQ_PM => { Test::More=>q[0], Object::Simple=>q[3.0616], DBD::SQLite=>q[1.25], DBI=>q[1.605] }
21
+#     VERSION_FROM => q[lib/DBIx/Custom.pm]
22
+#     clean => { FILES=>q[DBIx-Custom-*] }
23
+#     dist => { COMPRESS=>q[gzip -9f], SUFFIX=>q[gz] }
24
+
25
+# --- MakeMaker post_initialize section:
26
+
27
+
28
+# --- MakeMaker const_config section:
29
+
30
+# These definitions are from config.sh (via /usr/lib/perl5/5.8.8/i386-linux-thread-multi/Config.pm).
31
+# They may have been overridden via Makefile.PL or on the command line.
32
+AR = ar
33
+CC = gcc
34
+CCCDLFLAGS = -fPIC
35
+CCDLFLAGS = -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE
36
+DLEXT = so
37
+DLSRC = dl_dlopen.xs
38
+EXE_EXT = 
39
+FULL_AR = /usr/bin/ar
40
+LD = gcc
41
+LDDLFLAGS = -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -L/usr/local/lib
42
+LDFLAGS =  -L/usr/local/lib
43
+LIBC = /lib/libc-2.5.so
44
+LIB_EXT = .a
45
+OBJ_EXT = .o
46
+OSNAME = linux
47
+OSVERS = 2.6.18-53.el5
48
+RANLIB = :
49
+SITELIBEXP = /usr/lib/perl5/site_perl/5.8.8
50
+SITEARCHEXP = /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
51
+SO = so
52
+VENDORARCHEXP = /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
53
+VENDORLIBEXP = /usr/lib/perl5/vendor_perl/5.8.8
54
+
55
+
56
+# --- MakeMaker constants section:
57
+AR_STATIC_ARGS = cr
58
+DIRFILESEP = /
59
+DFSEP = $(DIRFILESEP)
60
+NAME = DBIx::Custom
61
+NAME_SYM = DBIx_Custom
62
+VERSION = 0.1661
63
+VERSION_MACRO = VERSION
64
+VERSION_SYM = 0_1661
65
+DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\"
66
+XS_VERSION = 0.1661
67
+XS_VERSION_MACRO = XS_VERSION
68
+XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\"
69
+INST_ARCHLIB = blib/arch
70
+INST_SCRIPT = blib/script
71
+INST_BIN = blib/bin
72
+INST_LIB = blib/lib
73
+INST_MAN1DIR = blib/man1
74
+INST_MAN3DIR = blib/man3
75
+MAN1EXT = 1
76
+MAN3EXT = 3pm
77
+INSTALLDIRS = site
78
+DESTDIR = 
79
+PREFIX = $(SITEPREFIX)
80
+PERLPREFIX = /usr
81
+SITEPREFIX = /usr
82
+VENDORPREFIX = /usr
83
+INSTALLPRIVLIB = /usr/lib/perl5/5.8.8
84
+DESTINSTALLPRIVLIB = $(DESTDIR)$(INSTALLPRIVLIB)
85
+INSTALLSITELIB = /usr/lib/perl5/site_perl/5.8.8
86
+DESTINSTALLSITELIB = $(DESTDIR)$(INSTALLSITELIB)
87
+INSTALLVENDORLIB = /usr/lib/perl5/vendor_perl/5.8.8
88
+DESTINSTALLVENDORLIB = $(DESTDIR)$(INSTALLVENDORLIB)
89
+INSTALLARCHLIB = /usr/lib/perl5/5.8.8/i386-linux-thread-multi
90
+DESTINSTALLARCHLIB = $(DESTDIR)$(INSTALLARCHLIB)
91
+INSTALLSITEARCH = /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
92
+DESTINSTALLSITEARCH = $(DESTDIR)$(INSTALLSITEARCH)
93
+INSTALLVENDORARCH = /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
94
+DESTINSTALLVENDORARCH = $(DESTDIR)$(INSTALLVENDORARCH)
95
+INSTALLBIN = /usr/bin
96
+DESTINSTALLBIN = $(DESTDIR)$(INSTALLBIN)
97
+INSTALLSITEBIN = /usr/bin
98
+DESTINSTALLSITEBIN = $(DESTDIR)$(INSTALLSITEBIN)
99
+INSTALLVENDORBIN = /usr/bin
100
+DESTINSTALLVENDORBIN = $(DESTDIR)$(INSTALLVENDORBIN)
101
+INSTALLSCRIPT = /usr/bin
102
+DESTINSTALLSCRIPT = $(DESTDIR)$(INSTALLSCRIPT)
103
+INSTALLSITESCRIPT = /usr/bin
104
+DESTINSTALLSITESCRIPT = $(DESTDIR)$(INSTALLSITESCRIPT)
105
+INSTALLVENDORSCRIPT = /usr/bin
106
+DESTINSTALLVENDORSCRIPT = $(DESTDIR)$(INSTALLVENDORSCRIPT)
107
+INSTALLMAN1DIR = /usr/share/man/man1
108
+DESTINSTALLMAN1DIR = $(DESTDIR)$(INSTALLMAN1DIR)
109
+INSTALLSITEMAN1DIR = /usr/share/man/man1
110
+DESTINSTALLSITEMAN1DIR = $(DESTDIR)$(INSTALLSITEMAN1DIR)
111
+INSTALLVENDORMAN1DIR = /usr/share/man/man1
112
+DESTINSTALLVENDORMAN1DIR = $(DESTDIR)$(INSTALLVENDORMAN1DIR)
113
+INSTALLMAN3DIR = /usr/share/man/man3
114
+DESTINSTALLMAN3DIR = $(DESTDIR)$(INSTALLMAN3DIR)
115
+INSTALLSITEMAN3DIR = /usr/share/man/man3
116
+DESTINSTALLSITEMAN3DIR = $(DESTDIR)$(INSTALLSITEMAN3DIR)
117
+INSTALLVENDORMAN3DIR = /usr/share/man/man3
118
+DESTINSTALLVENDORMAN3DIR = $(DESTDIR)$(INSTALLVENDORMAN3DIR)
119
+PERL_LIB = /usr/lib/perl5/5.8.8
120
+PERL_ARCHLIB = /usr/lib/perl5/5.8.8/i386-linux-thread-multi
121
+LIBPERL_A = libperl.a
122
+FIRST_MAKEFILE = Makefile
123
+MAKEFILE_OLD = Makefile.old
124
+MAKE_APERL_FILE = Makefile.aperl
125
+PERLMAINCC = $(CC)
126
+PERL_INC = /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE
127
+PERL = /usr/bin/perl
128
+FULLPERL = /usr/bin/perl
129
+ABSPERL = $(PERL)
130
+PERLRUN = $(PERL)
131
+FULLPERLRUN = $(FULLPERL)
132
+ABSPERLRUN = $(ABSPERL)
133
+PERLRUNINST = $(PERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"
134
+FULLPERLRUNINST = $(FULLPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"
135
+ABSPERLRUNINST = $(ABSPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"
136
+PERL_CORE = 0
137
+PERM_DIR = 755
138
+PERM_RW = 644
139
+PERM_RWX = 755
140
+
141
+MAKEMAKER   = /home/kimoto/perl5/lib/perl5/ExtUtils/MakeMaker.pm
142
+MM_VERSION  = 6.56
143
+MM_REVISION = 65600
144
+
145
+# FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle).
146
+# BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle)
147
+# PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar)
148
+# DLBASE  = Basename part of dynamic library. May be just equal BASEEXT.
149
+MAKE = make
150
+FULLEXT = DBIx/Custom
151
+BASEEXT = Custom
152
+PARENT_NAME = DBIx
153
+DLBASE = $(BASEEXT)
154
+VERSION_FROM = lib/DBIx/Custom.pm
155
+OBJECT = 
156
+LDFROM = $(OBJECT)
157
+LINKTYPE = dynamic
158
+BOOTDEP = 
159
+
160
+# Handy lists of source code files:
161
+XS_FILES = 
162
+C_FILES  = 
163
+O_FILES  = 
164
+H_FILES  = 
165
+MAN1PODS = 
166
+MAN3PODS = lib/DBIx/Custom.pm \
167
+	lib/DBIx/Custom/Guide.pod \
168
+	lib/DBIx/Custom/Guide/Ja.pod \
169
+	lib/DBIx/Custom/Model.pm \
170
+	lib/DBIx/Custom/MySQL.pm \
171
+	lib/DBIx/Custom/Query.pm \
172
+	lib/DBIx/Custom/QueryBuilder.pm \
173
+	lib/DBIx/Custom/Result.pm \
174
+	lib/DBIx/Custom/SQLite.pm \
175
+	lib/DBIx/Custom/Tag.pm \
176
+	lib/DBIx/Custom/Util.pm \
177
+	lib/DBIx/Custom/Where.pm
178
+
179
+# Where is the Config information that we are using/depend on
180
+CONFIGDEP = $(PERL_ARCHLIB)$(DFSEP)Config.pm $(PERL_INC)$(DFSEP)config.h
181
+
182
+# Where to build things
183
+INST_LIBDIR      = $(INST_LIB)/DBIx
184
+INST_ARCHLIBDIR  = $(INST_ARCHLIB)/DBIx
185
+
186
+INST_AUTODIR     = $(INST_LIB)/auto/$(FULLEXT)
187
+INST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT)
188
+
189
+INST_STATIC      = 
190
+INST_DYNAMIC     = 
191
+INST_BOOT        = 
192
+
193
+# Extra linker info
194
+EXPORT_LIST        = 
195
+PERL_ARCHIVE       = 
196
+PERL_ARCHIVE_AFTER = 
197
+
198
+
199
+TO_INST_PM = lib/DBIx/Custom.pm \
200
+	lib/DBIx/Custom/Guide.pod \
201
+	lib/DBIx/Custom/Guide/Ja.pod \
202
+	lib/DBIx/Custom/Model.pm \
203
+	lib/DBIx/Custom/MySQL.pm \
204
+	lib/DBIx/Custom/Query.pm \
205
+	lib/DBIx/Custom/QueryBuilder.pm \
206
+	lib/DBIx/Custom/Result.pm \
207
+	lib/DBIx/Custom/SQLite.pm \
208
+	lib/DBIx/Custom/Tag.pm \
209
+	lib/DBIx/Custom/Util.pm \
210
+	lib/DBIx/Custom/Where.pm
211
+
212
+PM_TO_BLIB = lib/DBIx/Custom/Tag.pm \
213
+	blib/lib/DBIx/Custom/Tag.pm \
214
+	lib/DBIx/Custom/Guide/Ja.pod \
215
+	blib/lib/DBIx/Custom/Guide/Ja.pod \
216
+	lib/DBIx/Custom/Util.pm \
217
+	blib/lib/DBIx/Custom/Util.pm \
218
+	lib/DBIx/Custom/Guide.pod \
219
+	blib/lib/DBIx/Custom/Guide.pod \
220
+	lib/DBIx/Custom/Where.pm \
221
+	blib/lib/DBIx/Custom/Where.pm \
222
+	lib/DBIx/Custom/Model.pm \
223
+	blib/lib/DBIx/Custom/Model.pm \
224
+	lib/DBIx/Custom/MySQL.pm \
225
+	blib/lib/DBIx/Custom/MySQL.pm \
226
+	lib/DBIx/Custom.pm \
227
+	blib/lib/DBIx/Custom.pm \
228
+	lib/DBIx/Custom/Query.pm \
229
+	blib/lib/DBIx/Custom/Query.pm \
230
+	lib/DBIx/Custom/SQLite.pm \
231
+	blib/lib/DBIx/Custom/SQLite.pm \
232
+	lib/DBIx/Custom/Result.pm \
233
+	blib/lib/DBIx/Custom/Result.pm \
234
+	lib/DBIx/Custom/QueryBuilder.pm \
235
+	blib/lib/DBIx/Custom/QueryBuilder.pm
236
+
237
+
238
+# --- MakeMaker platform_constants section:
239
+MM_Unix_VERSION = 6.56
240
+PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc
241
+
242
+
243
+# --- MakeMaker tool_autosplit section:
244
+# Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto
245
+AUTOSPLITFILE = $(ABSPERLRUN)  -e 'use AutoSplit;  autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1)' --
246
+
247
+
248
+
249
+# --- MakeMaker tool_xsubpp section:
250
+
251
+
252
+# --- MakeMaker tools_other section:
253
+SHELL = /bin/sh
254
+CHMOD = chmod
255
+CP = cp
256
+MV = mv
257
+NOOP = $(TRUE)
258
+NOECHO = @
259
+RM_F = rm -f
260
+RM_RF = rm -rf
261
+TEST_F = test -f
262
+TOUCH = touch
263
+UMASK_NULL = umask 0
264
+DEV_NULL = > /dev/null 2>&1
265
+MKPATH = $(ABSPERLRUN) -MExtUtils::Command -e 'mkpath' --
266
+EQUALIZE_TIMESTAMP = $(ABSPERLRUN) -MExtUtils::Command -e 'eqtime' --
267
+FALSE = false
268
+TRUE = true
269
+ECHO = echo
270
+ECHO_N = echo -n
271
+UNINST = 0
272
+VERBINST = 0
273
+MOD_INSTALL = $(ABSPERLRUN) -MExtUtils::Install -e 'install([ from_to => {@ARGV}, verbose => '\''$(VERBINST)'\'', uninstall_shadows => '\''$(UNINST)'\'', dir_mode => '\''$(PERM_DIR)'\'' ]);' --
274
+DOC_INSTALL = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'perllocal_install' --
275
+UNINSTALL = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'uninstall' --
276
+WARN_IF_OLD_PACKLIST = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'warn_if_old_packlist' --
277
+MACROSTART = 
278
+MACROEND = 
279
+USEMAKEFILE = -f
280
+FIXIN = $(ABSPERLRUN) -MExtUtils::MY -e 'MY->fixin(shift)' --
281
+
282
+
283
+# --- MakeMaker makemakerdflt section:
284
+makemakerdflt : all
285
+	$(NOECHO) $(NOOP)
286
+
287
+
288
+# --- MakeMaker dist section:
289
+TAR = tar
290
+TARFLAGS = cvf
291
+ZIP = zip
292
+ZIPFLAGS = -r
293
+COMPRESS = gzip -9f
294
+SUFFIX = gz
295
+SHAR = shar
296
+PREOP = $(NOECHO) $(NOOP)
297
+POSTOP = $(NOECHO) $(NOOP)
298
+TO_UNIX = $(NOECHO) $(NOOP)
299
+CI = ci -u
300
+RCS_LABEL = rcs -Nv$(VERSION_SYM): -q
301
+DIST_CP = best
302
+DIST_DEFAULT = tardist
303
+DISTNAME = DBIx-Custom
304
+DISTVNAME = DBIx-Custom-0.1661
305
+
306
+
307
+# --- MakeMaker macro section:
308
+
309
+
310
+# --- MakeMaker depend section:
311
+
312
+
313
+# --- MakeMaker cflags section:
314
+
315
+
316
+# --- MakeMaker const_loadlibs section:
317
+
318
+
319
+# --- MakeMaker const_cccmd section:
320
+
321
+
322
+# --- MakeMaker post_constants section:
323
+
324
+
325
+# --- MakeMaker pasthru section:
326
+
327
+PASTHRU = LIBPERL_A="$(LIBPERL_A)"\
328
+	LINKTYPE="$(LINKTYPE)"\
329
+	PREFIX="$(PREFIX)"
330
+
331
+
332
+# --- MakeMaker special_targets section:
333
+.SUFFIXES : .xs .c .C .cpp .i .s .cxx .cc $(OBJ_EXT)
334
+
335
+.PHONY: all config static dynamic test linkext manifest blibdirs clean realclean disttest distdir
336
+
337
+
338
+
339
+# --- MakeMaker c_o section:
340
+
341
+
342
+# --- MakeMaker xs_c section:
343
+
344
+
345
+# --- MakeMaker xs_o section:
346
+
347
+
348
+# --- MakeMaker top_targets section:
349
+all :: pure_all manifypods
350
+	$(NOECHO) $(NOOP)
351
+
352
+
353
+pure_all :: config pm_to_blib subdirs linkext
354
+	$(NOECHO) $(NOOP)
355
+
356
+subdirs :: $(MYEXTLIB)
357
+	$(NOECHO) $(NOOP)
358
+
359
+config :: $(FIRST_MAKEFILE) blibdirs
360
+	$(NOECHO) $(NOOP)
361
+
362
+help :
363
+	perldoc ExtUtils::MakeMaker
364
+
365
+
366
+# --- MakeMaker blibdirs section:
367
+blibdirs : $(INST_LIBDIR)$(DFSEP).exists $(INST_ARCHLIB)$(DFSEP).exists $(INST_AUTODIR)$(DFSEP).exists $(INST_ARCHAUTODIR)$(DFSEP).exists $(INST_BIN)$(DFSEP).exists $(INST_SCRIPT)$(DFSEP).exists $(INST_MAN1DIR)$(DFSEP).exists $(INST_MAN3DIR)$(DFSEP).exists
368
+	$(NOECHO) $(NOOP)
369
+
370
+# Backwards compat with 6.18 through 6.25
371
+blibdirs.ts : blibdirs
372
+	$(NOECHO) $(NOOP)
373
+
374
+$(INST_LIBDIR)$(DFSEP).exists :: Makefile.PL
375
+	$(NOECHO) $(MKPATH) $(INST_LIBDIR)
376
+	$(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_LIBDIR)
377
+	$(NOECHO) $(TOUCH) $(INST_LIBDIR)$(DFSEP).exists
378
+
379
+$(INST_ARCHLIB)$(DFSEP).exists :: Makefile.PL
380
+	$(NOECHO) $(MKPATH) $(INST_ARCHLIB)
381
+	$(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_ARCHLIB)
382
+	$(NOECHO) $(TOUCH) $(INST_ARCHLIB)$(DFSEP).exists
383
+
384
+$(INST_AUTODIR)$(DFSEP).exists :: Makefile.PL
385
+	$(NOECHO) $(MKPATH) $(INST_AUTODIR)
386
+	$(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_AUTODIR)
387
+	$(NOECHO) $(TOUCH) $(INST_AUTODIR)$(DFSEP).exists
388
+
389
+$(INST_ARCHAUTODIR)$(DFSEP).exists :: Makefile.PL
390
+	$(NOECHO) $(MKPATH) $(INST_ARCHAUTODIR)
391
+	$(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_ARCHAUTODIR)
392
+	$(NOECHO) $(TOUCH) $(INST_ARCHAUTODIR)$(DFSEP).exists
393
+
394
+$(INST_BIN)$(DFSEP).exists :: Makefile.PL
395
+	$(NOECHO) $(MKPATH) $(INST_BIN)
396
+	$(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_BIN)
397
+	$(NOECHO) $(TOUCH) $(INST_BIN)$(DFSEP).exists
398
+
399
+$(INST_SCRIPT)$(DFSEP).exists :: Makefile.PL
400
+	$(NOECHO) $(MKPATH) $(INST_SCRIPT)
401
+	$(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_SCRIPT)
402
+	$(NOECHO) $(TOUCH) $(INST_SCRIPT)$(DFSEP).exists
403
+
404
+$(INST_MAN1DIR)$(DFSEP).exists :: Makefile.PL
405
+	$(NOECHO) $(MKPATH) $(INST_MAN1DIR)
406
+	$(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_MAN1DIR)
407
+	$(NOECHO) $(TOUCH) $(INST_MAN1DIR)$(DFSEP).exists
408
+
409
+$(INST_MAN3DIR)$(DFSEP).exists :: Makefile.PL
410
+	$(NOECHO) $(MKPATH) $(INST_MAN3DIR)
411
+	$(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_MAN3DIR)
412
+	$(NOECHO) $(TOUCH) $(INST_MAN3DIR)$(DFSEP).exists
413
+
414
+
415
+
416
+# --- MakeMaker linkext section:
417
+
418
+linkext :: $(LINKTYPE)
419
+	$(NOECHO) $(NOOP)
420
+
421
+
422
+# --- MakeMaker dlsyms section:
423
+
424
+
425
+# --- MakeMaker dynamic section:
426
+
427
+dynamic :: $(FIRST_MAKEFILE) $(INST_DYNAMIC) $(INST_BOOT)
428
+	$(NOECHO) $(NOOP)
429
+
430
+
431
+# --- MakeMaker dynamic_bs section:
432
+
433
+BOOTSTRAP =
434
+
435
+
436
+# --- MakeMaker dynamic_lib section:
437
+
438
+
439
+# --- MakeMaker static section:
440
+
441
+## $(INST_PM) has been moved to the all: target.
442
+## It remains here for awhile to allow for old usage: "make static"
443
+static :: $(FIRST_MAKEFILE) $(INST_STATIC)
444
+	$(NOECHO) $(NOOP)
445
+
446
+
447
+# --- MakeMaker static_lib section:
448
+
449
+
450
+# --- MakeMaker manifypods section:
451
+
452
+POD2MAN_EXE = $(PERLRUN) "-MExtUtils::Command::MM" -e pod2man "--"
453
+POD2MAN = $(POD2MAN_EXE)
454
+
455
+
456
+manifypods : pure_all  \
457
+	lib/DBIx/Custom/Tag.pm \
458
+	lib/DBIx/Custom/Guide/Ja.pod \
459
+	lib/DBIx/Custom/Util.pm \
460
+	lib/DBIx/Custom/Guide.pod \
461
+	lib/DBIx/Custom/Where.pm \
462
+	lib/DBIx/Custom/Model.pm \
463
+	lib/DBIx/Custom/MySQL.pm \
464
+	lib/DBIx/Custom.pm \
465
+	lib/DBIx/Custom/Query.pm \
466
+	lib/DBIx/Custom/SQLite.pm \
467
+	lib/DBIx/Custom/Result.pm \
468
+	lib/DBIx/Custom/QueryBuilder.pm
469
+	$(NOECHO) $(POD2MAN) --section=3 --perm_rw=$(PERM_RW) \
470
+	  lib/DBIx/Custom/Tag.pm $(INST_MAN3DIR)/DBIx::Custom::Tag.$(MAN3EXT) \
471
+	  lib/DBIx/Custom/Guide/Ja.pod $(INST_MAN3DIR)/DBIx::Custom::Guide::Ja.$(MAN3EXT) \
472
+	  lib/DBIx/Custom/Util.pm $(INST_MAN3DIR)/DBIx::Custom::Util.$(MAN3EXT) \
473
+	  lib/DBIx/Custom/Guide.pod $(INST_MAN3DIR)/DBIx::Custom::Guide.$(MAN3EXT) \
474
+	  lib/DBIx/Custom/Where.pm $(INST_MAN3DIR)/DBIx::Custom::Where.$(MAN3EXT) \
475
+	  lib/DBIx/Custom/Model.pm $(INST_MAN3DIR)/DBIx::Custom::Model.$(MAN3EXT) \
476
+	  lib/DBIx/Custom/MySQL.pm $(INST_MAN3DIR)/DBIx::Custom::MySQL.$(MAN3EXT) \
477
+	  lib/DBIx/Custom.pm $(INST_MAN3DIR)/DBIx::Custom.$(MAN3EXT) \
478
+	  lib/DBIx/Custom/Query.pm $(INST_MAN3DIR)/DBIx::Custom::Query.$(MAN3EXT) \
479
+	  lib/DBIx/Custom/SQLite.pm $(INST_MAN3DIR)/DBIx::Custom::SQLite.$(MAN3EXT) \
480
+	  lib/DBIx/Custom/Result.pm $(INST_MAN3DIR)/DBIx::Custom::Result.$(MAN3EXT) \
481
+	  lib/DBIx/Custom/QueryBuilder.pm $(INST_MAN3DIR)/DBIx::Custom::QueryBuilder.$(MAN3EXT) 
482
+
483
+
484
+
485
+
486
+# --- MakeMaker processPL section:
487
+
488
+
489
+# --- MakeMaker installbin section:
490
+
491
+
492
+# --- MakeMaker subdirs section:
493
+
494
+# The default clean, realclean and test targets in this Makefile
495
+# have automatically been given entries for each subdir.
496
+
497
+
498
+subdirs ::
499
+	$(NOECHO) cd DBIx-Custom-0.1660 && $(MAKE) $(USEMAKEFILE) $(FIRST_MAKEFILE) all $(PASTHRU)
500
+
501
+
502
+# --- MakeMaker clean_subdirs section:
503
+clean_subdirs :
504
+	$(ABSPERLRUN)  -e 'chdir '\''DBIx-Custom-0.1660'\'';  system '\''$(MAKE) clean'\'' if -f '\''$(FIRST_MAKEFILE)'\'';' --
505
+
506
+
507
+# --- MakeMaker clean section:
508
+
509
+# Delete temporary files but do not touch installed files. We don't delete
510
+# the Makefile here so a later make realclean still has a makefile to use.
511
+
512
+clean :: clean_subdirs
513
+	- $(RM_F) \
514
+	  *$(LIB_EXT) core \
515
+	  core.[0-9] $(INST_ARCHAUTODIR)/extralibs.all \
516
+	  core.[0-9][0-9] $(BASEEXT).bso \
517
+	  pm_to_blib.ts core.[0-9][0-9][0-9][0-9] \
518
+	  $(BASEEXT).x $(BOOTSTRAP) \
519
+	  perl$(EXE_EXT) tmon.out \
520
+	  *$(OBJ_EXT) pm_to_blib \
521
+	  $(INST_ARCHAUTODIR)/extralibs.ld blibdirs.ts \
522
+	  core.[0-9][0-9][0-9][0-9][0-9] *perl.core \
523
+	  core.*perl.*.? $(MAKE_APERL_FILE) \
524
+	  $(BASEEXT).def perl \
525
+	  core.[0-9][0-9][0-9] mon.out \
526
+	  lib$(BASEEXT).def perl.exe \
527
+	  perlmain.c so_locations \
528
+	  $(BASEEXT).exp 
529
+	- $(RM_RF) \
530
+	  DBIx-Custom-* blib 
531
+	- $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) $(DEV_NULL)
532
+
533
+
534
+# --- MakeMaker realclean_subdirs section:
535
+realclean_subdirs :
536
+	- $(ABSPERLRUN)  -e 'chdir '\''DBIx-Custom-0.1660'\'';  system '\''$(MAKE) $(USEMAKEFILE) $(MAKEFILE_OLD) realclean'\'' if -f '\''$(MAKEFILE_OLD)'\'';' --
537
+	- $(ABSPERLRUN)  -e 'chdir '\''DBIx-Custom-0.1660'\'';  system '\''$(MAKE) $(USEMAKEFILE) $(FIRST_MAKEFILE) realclean'\'' if -f '\''$(FIRST_MAKEFILE)'\'';' --
538
+
539
+
540
+# --- MakeMaker realclean section:
541
+# Delete temporary files (via clean) and also delete dist files
542
+realclean purge ::  clean realclean_subdirs
543
+	- $(RM_F) \
544
+	  $(MAKEFILE_OLD) $(FIRST_MAKEFILE) 
545
+	- $(RM_RF) \
546
+	  $(DISTVNAME) 
547
+
548
+
549
+# --- MakeMaker metafile section:
550
+metafile : create_distdir
551
+	$(NOECHO) $(ECHO) Generating META.yml
552
+	$(NOECHO) $(ECHO) '--- #YAML:1.0' > META_new.yml
553
+	$(NOECHO) $(ECHO) 'name:               DBIx-Custom' >> META_new.yml
554
+	$(NOECHO) $(ECHO) 'version:            0.1661' >> META_new.yml
555
+	$(NOECHO) $(ECHO) 'abstract:           Useful database access, respecting SQL!' >> META_new.yml
556
+	$(NOECHO) $(ECHO) 'author:' >> META_new.yml
557
+	$(NOECHO) $(ECHO) '    - Yuki Kimoto <kimoto.yuki@gmail.com>' >> META_new.yml
558
+	$(NOECHO) $(ECHO) 'license:            perl' >> META_new.yml
559
+	$(NOECHO) $(ECHO) 'distribution_type:  module' >> META_new.yml
560
+	$(NOECHO) $(ECHO) 'configure_requires:' >> META_new.yml
561
+	$(NOECHO) $(ECHO) '    ExtUtils::MakeMaker:  0' >> META_new.yml
562
+	$(NOECHO) $(ECHO) 'build_requires:' >> META_new.yml
563
+	$(NOECHO) $(ECHO) '    ExtUtils::MakeMaker:  0' >> META_new.yml
564
+	$(NOECHO) $(ECHO) 'requires:' >> META_new.yml
565
+	$(NOECHO) $(ECHO) '    DBD::SQLite:     1.25' >> META_new.yml
566
+	$(NOECHO) $(ECHO) '    DBI:             1.605' >> META_new.yml
567
+	$(NOECHO) $(ECHO) '    Object::Simple:  3.0616' >> META_new.yml
568
+	$(NOECHO) $(ECHO) '    Test::More:      0' >> META_new.yml
569
+	$(NOECHO) $(ECHO) 'no_index:' >> META_new.yml
570
+	$(NOECHO) $(ECHO) '    directory:' >> META_new.yml
571
+	$(NOECHO) $(ECHO) '        - t' >> META_new.yml
572
+	$(NOECHO) $(ECHO) '        - inc' >> META_new.yml
573
+	$(NOECHO) $(ECHO) 'generated_by:       ExtUtils::MakeMaker version 6.56' >> META_new.yml
574
+	$(NOECHO) $(ECHO) 'meta-spec:' >> META_new.yml
575
+	$(NOECHO) $(ECHO) '    url:      http://module-build.sourceforge.net/META-spec-v1.4.html' >> META_new.yml
576
+	$(NOECHO) $(ECHO) '    version:  1.4' >> META_new.yml
577
+	-$(NOECHO) $(MV) META_new.yml $(DISTVNAME)/META.yml
578
+
579
+
580
+# --- MakeMaker signature section:
581
+signature :
582
+	cpansign -s
583
+
584
+
585
+# --- MakeMaker dist_basics section:
586
+distclean :: realclean distcheck
587
+	$(NOECHO) $(NOOP)
588
+
589
+distcheck :
590
+	$(PERLRUN) "-MExtUtils::Manifest=fullcheck" -e fullcheck
591
+
592
+skipcheck :
593
+	$(PERLRUN) "-MExtUtils::Manifest=skipcheck" -e skipcheck
594
+
595
+manifest :
596
+	$(PERLRUN) "-MExtUtils::Manifest=mkmanifest" -e mkmanifest
597
+
598
+veryclean : realclean
599
+	$(RM_F) *~ */*~ *.orig */*.orig *.bak */*.bak *.old */*.old 
600
+
601
+
602
+
603
+# --- MakeMaker dist_core section:
604
+
605
+dist : $(DIST_DEFAULT) $(FIRST_MAKEFILE)
606
+	$(NOECHO) $(ABSPERLRUN) -l -e 'print '\''Warning: Makefile possibly out of date with $(VERSION_FROM)'\''' \
607
+	  -e '    if -e '\''$(VERSION_FROM)'\'' and -M '\''$(VERSION_FROM)'\'' < -M '\''$(FIRST_MAKEFILE)'\'';' --
608
+
609
+tardist : $(DISTVNAME).tar$(SUFFIX)
610
+	$(NOECHO) $(NOOP)
611
+
612
+uutardist : $(DISTVNAME).tar$(SUFFIX)
613
+	uuencode $(DISTVNAME).tar$(SUFFIX) $(DISTVNAME).tar$(SUFFIX) > $(DISTVNAME).tar$(SUFFIX)_uu
614
+
615
+$(DISTVNAME).tar$(SUFFIX) : distdir
616
+	$(PREOP)
617
+	$(TO_UNIX)
618
+	$(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME)
619
+	$(RM_RF) $(DISTVNAME)
620
+	$(COMPRESS) $(DISTVNAME).tar
621
+	$(POSTOP)
622
+
623
+zipdist : $(DISTVNAME).zip
624
+	$(NOECHO) $(NOOP)
625
+
626
+$(DISTVNAME).zip : distdir
627
+	$(PREOP)
628
+	$(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME)
629
+	$(RM_RF) $(DISTVNAME)
630
+	$(POSTOP)
631
+
632
+shdist : distdir
633
+	$(PREOP)
634
+	$(SHAR) $(DISTVNAME) > $(DISTVNAME).shar
635
+	$(RM_RF) $(DISTVNAME)
636
+	$(POSTOP)
637
+
638
+
639
+# --- MakeMaker distdir section:
640
+create_distdir :
641
+	$(RM_RF) $(DISTVNAME)
642
+	$(PERLRUN) "-MExtUtils::Manifest=manicopy,maniread" \
643
+		-e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');"
644
+
645
+distdir : create_distdir distmeta 
646
+	$(NOECHO) $(NOOP)
647
+
648
+
649
+
650
+# --- MakeMaker dist_test section:
651
+disttest : distdir
652
+	cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL 
653
+	cd $(DISTVNAME) && $(MAKE) $(PASTHRU)
654
+	cd $(DISTVNAME) && $(MAKE) test $(PASTHRU)
655
+
656
+
657
+
658
+# --- MakeMaker dist_ci section:
659
+
660
+ci :
661
+	$(PERLRUN) "-MExtUtils::Manifest=maniread" \
662
+	  -e "@all = keys %{ maniread() };" \
663
+	  -e "print(qq{Executing $(CI) @all\n}); system(qq{$(CI) @all});" \
664
+	  -e "print(qq{Executing $(RCS_LABEL) ...\n}); system(qq{$(RCS_LABEL) @all});"
665
+
666
+
667
+# --- MakeMaker distmeta section:
668
+distmeta : create_distdir metafile
669
+	$(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{META.yml} => q{Module meta-data (added by MakeMaker)}}) } ' \
670
+	  -e '    or print "Could not add META.yml to MANIFEST: $${'\''@'\''}\n"' --
671
+
672
+
673
+
674
+# --- MakeMaker distsignature section:
675
+distsignature : create_distdir
676
+	$(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{SIGNATURE} => q{Public-key signature (added by MakeMaker)}}) } ' \
677
+	  -e '    or print "Could not add SIGNATURE to MANIFEST: $${'\''@'\''}\n"' --
678
+	$(NOECHO) cd $(DISTVNAME) && $(TOUCH) SIGNATURE
679
+	cd $(DISTVNAME) && cpansign -s
680
+
681
+
682
+
683
+# --- MakeMaker install section:
684
+
685
+install :: pure_install doc_install
686
+	$(NOECHO) $(NOOP)
687
+
688
+install_perl :: pure_perl_install doc_perl_install
689
+	$(NOECHO) $(NOOP)
690
+
691
+install_site :: pure_site_install doc_site_install
692
+	$(NOECHO) $(NOOP)
693
+
694
+install_vendor :: pure_vendor_install doc_vendor_install
695
+	$(NOECHO) $(NOOP)
696
+
697
+pure_install :: pure_$(INSTALLDIRS)_install
698
+	$(NOECHO) $(NOOP)
699
+
700
+doc_install :: doc_$(INSTALLDIRS)_install
701
+	$(NOECHO) $(NOOP)
702
+
703
+pure__install : pure_site_install
704
+	$(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
705
+
706
+doc__install : doc_site_install
707
+	$(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
708
+
709
+pure_perl_install :: all
710
+	$(NOECHO) $(MOD_INSTALL) \
711
+		read $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist \
712
+		write $(DESTINSTALLARCHLIB)/auto/$(FULLEXT)/.packlist \
713
+		$(INST_LIB) $(DESTINSTALLPRIVLIB) \
714
+		$(INST_ARCHLIB) $(DESTINSTALLARCHLIB) \
715
+		$(INST_BIN) $(DESTINSTALLBIN) \
716
+		$(INST_SCRIPT) $(DESTINSTALLSCRIPT) \
717
+		$(INST_MAN1DIR) $(DESTINSTALLMAN1DIR) \
718
+		$(INST_MAN3DIR) $(DESTINSTALLMAN3DIR)
719
+	$(NOECHO) $(WARN_IF_OLD_PACKLIST) \
720
+		$(SITEARCHEXP)/auto/$(FULLEXT)
721
+
722
+
723
+pure_site_install :: all
724
+	$(NOECHO) $(MOD_INSTALL) \
725
+		read $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist \
726
+		write $(DESTINSTALLSITEARCH)/auto/$(FULLEXT)/.packlist \
727
+		$(INST_LIB) $(DESTINSTALLSITELIB) \
728
+		$(INST_ARCHLIB) $(DESTINSTALLSITEARCH) \
729
+		$(INST_BIN) $(DESTINSTALLSITEBIN) \
730
+		$(INST_SCRIPT) $(DESTINSTALLSITESCRIPT) \
731
+		$(INST_MAN1DIR) $(DESTINSTALLSITEMAN1DIR) \
732
+		$(INST_MAN3DIR) $(DESTINSTALLSITEMAN3DIR)
733
+	$(NOECHO) $(WARN_IF_OLD_PACKLIST) \
734
+		$(PERL_ARCHLIB)/auto/$(FULLEXT)
735
+
736
+pure_vendor_install :: all
737
+	$(NOECHO) $(MOD_INSTALL) \
738
+		read $(VENDORARCHEXP)/auto/$(FULLEXT)/.packlist \
739
+		write $(DESTINSTALLVENDORARCH)/auto/$(FULLEXT)/.packlist \
740
+		$(INST_LIB) $(DESTINSTALLVENDORLIB) \
741
+		$(INST_ARCHLIB) $(DESTINSTALLVENDORARCH) \
742
+		$(INST_BIN) $(DESTINSTALLVENDORBIN) \
743
+		$(INST_SCRIPT) $(DESTINSTALLVENDORSCRIPT) \
744
+		$(INST_MAN1DIR) $(DESTINSTALLVENDORMAN1DIR) \
745
+		$(INST_MAN3DIR) $(DESTINSTALLVENDORMAN3DIR)
746
+
747
+doc_perl_install :: all
748
+	$(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod
749
+	-$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
750
+	-$(NOECHO) $(DOC_INSTALL) \
751
+		"Module" "$(NAME)" \
752
+		"installed into" "$(INSTALLPRIVLIB)" \
753
+		LINKTYPE "$(LINKTYPE)" \
754
+		VERSION "$(VERSION)" \
755
+		EXE_FILES "$(EXE_FILES)" \
756
+		>> $(DESTINSTALLARCHLIB)/perllocal.pod
757
+
758
+doc_site_install :: all
759
+	$(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod
760
+	-$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
761
+	-$(NOECHO) $(DOC_INSTALL) \
762
+		"Module" "$(NAME)" \
763
+		"installed into" "$(INSTALLSITELIB)" \
764
+		LINKTYPE "$(LINKTYPE)" \
765
+		VERSION "$(VERSION)" \
766
+		EXE_FILES "$(EXE_FILES)" \
767
+		>> $(DESTINSTALLARCHLIB)/perllocal.pod
768
+
769
+doc_vendor_install :: all
770
+	$(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod
771
+	-$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
772
+	-$(NOECHO) $(DOC_INSTALL) \
773
+		"Module" "$(NAME)" \
774
+		"installed into" "$(INSTALLVENDORLIB)" \
775
+		LINKTYPE "$(LINKTYPE)" \
776
+		VERSION "$(VERSION)" \
777
+		EXE_FILES "$(EXE_FILES)" \
778
+		>> $(DESTINSTALLARCHLIB)/perllocal.pod
779
+
780
+
781
+uninstall :: uninstall_from_$(INSTALLDIRS)dirs
782
+	$(NOECHO) $(NOOP)
783
+
784
+uninstall_from_perldirs ::
785
+	$(NOECHO) $(UNINSTALL) $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist
786
+
787
+uninstall_from_sitedirs ::
788
+	$(NOECHO) $(UNINSTALL) $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist
789
+
790
+uninstall_from_vendordirs ::
791
+	$(NOECHO) $(UNINSTALL) $(VENDORARCHEXP)/auto/$(FULLEXT)/.packlist
792
+
793
+
794
+# --- MakeMaker force section:
795
+# Phony target to force checking subdirectories.
796
+FORCE :
797
+	$(NOECHO) $(NOOP)
798
+
799
+
800
+# --- MakeMaker perldepend section:
801
+
802
+
803
+# --- MakeMaker makefile section:
804
+# We take a very conservative approach here, but it's worth it.
805
+# We move Makefile to Makefile.old here to avoid gnu make looping.
806
+$(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP)
807
+	$(NOECHO) $(ECHO) "Makefile out-of-date with respect to $?"
808
+	$(NOECHO) $(ECHO) "Cleaning current config before rebuilding Makefile..."
809
+	-$(NOECHO) $(RM_F) $(MAKEFILE_OLD)
810
+	-$(NOECHO) $(MV)   $(FIRST_MAKEFILE) $(MAKEFILE_OLD)
811
+	- $(MAKE) $(USEMAKEFILE) $(MAKEFILE_OLD) clean $(DEV_NULL)
812
+	$(PERLRUN) Makefile.PL 
813
+	$(NOECHO) $(ECHO) "==> Your Makefile has been rebuilt. <=="
814
+	$(NOECHO) $(ECHO) "==> Please rerun the $(MAKE) command.  <=="
815
+	$(FALSE)
816
+
817
+
818
+
819
+# --- MakeMaker staticmake section:
820
+
821
+# --- MakeMaker makeaperl section ---
822
+MAP_TARGET    = perl
823
+FULLPERL      = /usr/bin/perl
824
+
825
+$(MAP_TARGET) :: static $(MAKE_APERL_FILE)
826
+	$(MAKE) $(USEMAKEFILE) $(MAKE_APERL_FILE) $@
827
+
828
+$(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) pm_to_blib
829
+	$(NOECHO) $(ECHO) Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET)
830
+	$(NOECHO) $(PERLRUNINST) \
831
+		Makefile.PL DIR=DBIx-Custom-0.1660 \
832
+		MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \
833
+		MAKEAPERL=1 NORECURS=1 CCCDLFLAGS=
834
+
835
+
836
+# --- MakeMaker test section:
837
+
838
+TEST_VERBOSE=0
839
+TEST_TYPE=test_$(LINKTYPE)
840
+TEST_FILE = test.pl
841
+TEST_FILES = t/*.t
842
+TESTDB_SW = -d
843
+
844
+testdb :: testdb_$(LINKTYPE)
845
+
846
+test :: $(TEST_TYPE) subdirs-test
847
+
848
+subdirs-test ::
849
+	$(NOECHO) $(NOOP)
850
+
851
+subdirs-test ::
852
+	$(NOECHO) cd DBIx-Custom-0.1660 && $(MAKE) test $(PASTHRU)
853
+
854
+
855
+test_dynamic :: pure_all
856
+	PERL_DL_NONLAZY=1 $(FULLPERLRUN) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES)
857
+
858
+testdb_dynamic :: pure_all
859
+	PERL_DL_NONLAZY=1 $(FULLPERLRUN) $(TESTDB_SW) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE)
860
+
861
+test_ : test_dynamic
862
+
863
+test_static :: test_dynamic
864
+testdb_static :: testdb_dynamic
865
+
866
+
867
+# --- MakeMaker ppd section:
868
+# Creates a PPD (Perl Package Description) for a binary distribution.
869
+ppd :
870
+	$(NOECHO) $(ECHO) '<SOFTPKG NAME="$(DISTNAME)" VERSION="0.1661">' > $(DISTNAME).ppd
871
+	$(NOECHO) $(ECHO) '    <ABSTRACT>Useful database access, respecting SQL!</ABSTRACT>' >> $(DISTNAME).ppd
872
+	$(NOECHO) $(ECHO) '    <AUTHOR>Yuki Kimoto &lt;kimoto.yuki@gmail.com&gt;</AUTHOR>' >> $(DISTNAME).ppd
873
+	$(NOECHO) $(ECHO) '    <IMPLEMENTATION>' >> $(DISTNAME).ppd
874
+	$(NOECHO) $(ECHO) '        <REQUIRE NAME="DBD::SQLite" VERSION="1.25" />' >> $(DISTNAME).ppd
875
+	$(NOECHO) $(ECHO) '        <REQUIRE NAME="DBI::" VERSION="1.605" />' >> $(DISTNAME).ppd
876
+	$(NOECHO) $(ECHO) '        <REQUIRE NAME="Object::Simple" VERSION="3.0616" />' >> $(DISTNAME).ppd
877
+	$(NOECHO) $(ECHO) '        <REQUIRE NAME="Test::More" />' >> $(DISTNAME).ppd
878
+	$(NOECHO) $(ECHO) '        <ARCHITECTURE NAME="i386-linux-thread-multi-5.8" />' >> $(DISTNAME).ppd
879
+	$(NOECHO) $(ECHO) '        <CODEBASE HREF="" />' >> $(DISTNAME).ppd
880
+	$(NOECHO) $(ECHO) '    </IMPLEMENTATION>' >> $(DISTNAME).ppd
881
+	$(NOECHO) $(ECHO) '</SOFTPKG>' >> $(DISTNAME).ppd
882
+
883
+
884
+# --- MakeMaker pm_to_blib section:
885
+
886
+pm_to_blib : $(FIRST_MAKEFILE) $(TO_INST_PM)
887
+	$(NOECHO) $(ABSPERLRUN) -MExtUtils::Install -e 'pm_to_blib({@ARGV}, '\''$(INST_LIB)/auto'\'', q[$(PM_FILTER)], '\''$(PERM_DIR)'\'')' -- \
888
+	  lib/DBIx/Custom/Tag.pm blib/lib/DBIx/Custom/Tag.pm \
889
+	  lib/DBIx/Custom/Guide/Ja.pod blib/lib/DBIx/Custom/Guide/Ja.pod \
890
+	  lib/DBIx/Custom/Util.pm blib/lib/DBIx/Custom/Util.pm \
891
+	  lib/DBIx/Custom/Guide.pod blib/lib/DBIx/Custom/Guide.pod \
892
+	  lib/DBIx/Custom/Where.pm blib/lib/DBIx/Custom/Where.pm \
893
+	  lib/DBIx/Custom/Model.pm blib/lib/DBIx/Custom/Model.pm \
894
+	  lib/DBIx/Custom/MySQL.pm blib/lib/DBIx/Custom/MySQL.pm \
895
+	  lib/DBIx/Custom.pm blib/lib/DBIx/Custom.pm \
896
+	  lib/DBIx/Custom/Query.pm blib/lib/DBIx/Custom/Query.pm \
897
+	  lib/DBIx/Custom/SQLite.pm blib/lib/DBIx/Custom/SQLite.pm \
898
+	  lib/DBIx/Custom/Result.pm blib/lib/DBIx/Custom/Result.pm \
899
+	  lib/DBIx/Custom/QueryBuilder.pm blib/lib/DBIx/Custom/QueryBuilder.pm 
900
+	$(NOECHO) $(TOUCH) pm_to_blib
901
+
902
+
903
+# --- MakeMaker selfdocument section:
904
+
905
+
906
+# --- MakeMaker postamble section:
907
+
908
+
909
+# End.
+191 -182
lib/DBIx/Custom.pm
... ...
@@ -1,6 +1,6 @@
1 1
 package DBIx::Custom;
2 2
 
3
-our $VERSION = '0.1660';
3
+our $VERSION = '0.1661';
4 4
 
5 5
 use 5.008001;
6 6
 use strict;
... ...
@@ -69,8 +69,8 @@ sub AUTOLOAD {
69 69
     if (my $method = $self->{_methods}->{$mname}) {
70 70
         return $self->$method(@_)
71 71
     }
72
-    elsif ($self->dbh->can($mname)) {
73
-        $self->dbh->$mname(@_);
72
+    elsif (my $dbh_method = $self->dbh->can($mname)) {
73
+        $self->dbh->$dbh_method(@_);
74 74
     }
75 75
     else {
76 76
         croak qq/Can't locate object method "$mname" via "$package"/
... ...
@@ -375,6 +375,32 @@ sub execute{
375 375
     my %table_set = map {defined $_ ? ($_ => 1) : ()} @$tables;
376 376
     my $main_table = pop @$tables;
377 377
     delete $table_set{$main_table} if $main_table;
378
+    foreach my $table (keys %table_set) {
379
+        push @$tables, $table;
380
+        
381
+        if (my $dist = $self->{_table_alias}->{$table}) {
382
+            $self->{filter} ||= {};
383
+            
384
+            unless ($self->{filter}{out}{$table}) {
385
+                $self->{filter}{out} ||= {};
386
+                $self->{filter}{in}  ||= {};
387
+                $self->{filter}{end} ||= {};
388
+                
389
+                foreach my $type (qw/out in end/) {
390
+                    
391
+                    foreach my $filter_name (keys %{$self->{filter}{$type}{$dist} || {}}) {
392
+                        my $filter_name_alias = $filter_name;
393
+                        $filter_name_alias =~ s/^$dist\./$table\./;
394
+                        $filter_name_alias =~ s/^${dist}__/${table}__/; 
395
+                        
396
+                        $self->{filter}{$type}{$table}{$filter_name_alias}
397
+                          = $self->{filter}{$type}{$dist}{$filter_name}
398
+                    }
399
+                }
400
+            }
401
+        }
402
+    }
403
+    
378 404
     $tables = [keys %table_set];
379 405
     push @$tables, $main_table if $main_table;
380 406
     
... ...
@@ -579,6 +605,99 @@ sub each_column {
579 605
     }
580 606
 }
581 607
 
608
+sub include_model {
609
+    my ($self, $name_space, $model_infos) = @_;
610
+    
611
+    $name_space ||= '';
612
+    unless ($model_infos) {
613
+        # Load name space module
614
+        croak qq{"$name_space" is invalid class name}
615
+          if $name_space =~ /[^\w:]/;
616
+        eval "use $name_space";
617
+        croak qq{Name space module "$name_space.pm" is needed. $@} if $@;
618
+        
619
+        # Search model modules
620
+        my $path = $INC{"$name_space.pm"};
621
+        $path =~ s/\.pm$//;
622
+        opendir my $dh, $path
623
+          or croak qq{Can't open directory "$path": $!};
624
+        $model_infos = [];
625
+        while (my $module = readdir $dh) {
626
+            push @$model_infos, $module
627
+              if $module =~ s/\.pm$//;
628
+        }
629
+        
630
+        close $dh;
631
+    }
632
+    
633
+    my $table_alias = {};
634
+    foreach my $model_info (@$model_infos) {
635
+        
636
+        # Model class, name, table
637
+        my $model_class;
638
+        my $model_name;
639
+        my $model_table;
640
+        if (ref $model_info eq 'HASH') {
641
+            $model_class = $model_info->{class};
642
+            $model_name  = $model_info->{name};
643
+            $model_table = $model_info->{table};
644
+            
645
+            $model_name  ||= $model_class;
646
+            $model_table ||= $model_name;
647
+        }
648
+        else { $model_class =$model_name = $model_table = $model_info }
649
+        my $mclass = "${name_space}::$model_class";
650
+        
651
+        # Load
652
+        croak qq{"$mclass" is invalid class name}
653
+          if $mclass =~ /[^\w:]/;
654
+        unless ($mclass->can('isa')) {
655
+            eval "use $mclass";
656
+            croak $@ if $@;
657
+        }
658
+        
659
+        # Instantiate
660
+        my $model = $mclass->new(dbi => $self);
661
+        $model->name($model_name) unless $model->name;
662
+        $model->table($model_table) unless $model->table;
663
+        
664
+        # Set
665
+        $self->model($model->name, $model);
666
+        
667
+        # Apply filter
668
+        croak "${name_space}::$model_class filter must be array reference"
669
+          unless ref $model->filter eq 'ARRAY';
670
+        $self->apply_filter($model->table, @{$model->filter});
671
+        
672
+        # Table alias
673
+        $table_alias = {%$table_alias, %{$model->table_alias}};
674
+        
675
+        # Table - Model
676
+        $self->{_model_from}->{$model->table} = $model->name;
677
+    }
678
+    
679
+    $self->{_table_alias} = $table_alias;
680
+    
681
+    return $self;
682
+}
683
+
684
+sub model {
685
+    my ($self, $name, $model) = @_;
686
+    
687
+    # Set
688
+    if ($model) {
689
+        $self->models->{$name} = $model;
690
+        return $self;
691
+    }
692
+    
693
+    # Check model existance
694
+    croak qq{Model "$name" is not included}
695
+      unless $self->models->{$name};
696
+    
697
+    # Get
698
+    return $self->models->{$name};
699
+}
700
+
582 701
 sub new {
583 702
     my $self = shift->SUPER::new(@_);
584 703
     
... ...
@@ -622,7 +741,7 @@ sub register_tag { shift->query_builder->register_tag(@_) }
622 741
 
623 742
 our %VALID_SELECT_ARGS
624 743
   = map { $_ => 1 } qw/table column where append relation filter query
625
-                       selection join all_column/;
744
+                       selection join/;
626 745
 
627 746
 sub select {
628 747
     my ($self, %args) = @_;
... ...
@@ -638,9 +757,7 @@ sub select {
638 757
     my $tables = ref $table eq 'ARRAY' ? $table
639 758
                : defined $table ? [$table]
640 759
                : [];
641
-    my $columns   = $args{column} || [];
642
-    $columns = [$columns] unless ref $columns eq 'ARRAY';
643
-    my $all_column = $args{all_column};
760
+    my $columns   = $args{column};
644 761
     my $selection = $args{selection} || '';
645 762
     my $where     = $args{where} || {};
646 763
     my $append    = $args{append};
... ...
@@ -665,56 +782,60 @@ sub select {
665 782
         unshift @$tables, @{$self->_tables($selection)};
666 783
     }
667 784
     
668
-    # Clumn clause, countains all columns of joined tables
669
-    elsif ($all_column) {
670
-    
671
-        # Find tables
672
-        my $main_table;
673
-        my %tables;
674
-        if (ref $all_column eq 'ARRAY') {
675
-            foreach my $table (@$all_column) {
676
-                if (($table || '') eq $tables->[-1]) {
677
-                    $main_table = $table;
785
+    # Column clause
786
+    elsif ($columns) {
787
+
788
+        $columns = [$columns] if ! ref $columns;
789
+        
790
+        if (ref $columns eq 'HASH') {
791
+            # Find tables
792
+            my $main_table;
793
+            my %tables;
794
+            if ($columns->{table}) {
795
+                foreach my $table (@{$columns->{table}}) {
796
+                    if (($table || '') eq $tables->[-1]) {
797
+                        $main_table = $table;
798
+                    }
799
+                    else {
800
+                        $tables{$table} = 1;
801
+                    }
678 802
                 }
679
-                else {
680
-                    $tables{$table} = 1;
803
+            }
804
+            elsif ($columns->{all}) {
805
+                $main_table = $tables->[-1] || '';
806
+                foreach my $j (@$join) {
807
+                    my $tables = $self->_tables($j);
808
+                    foreach my $table (@$tables) {
809
+                        $tables{$table} = 1;
810
+                    }
681 811
                 }
812
+                delete $tables{$main_table};
813
+            }
814
+            
815
+            push @sql, $columns->{prepend} if $columns->{prepend};
816
+            
817
+            # Column clause of main table
818
+            if ($main_table) {
819
+                push @sql, $self->model($main_table)->column_clause;
820
+                push @sql, ',';
682 821
             }
822
+            
823
+            # Column cluase of other tables
824
+            foreach my $table (keys %tables) {
825
+                unshift @$tables, $table;
826
+                push @sql, $self->model($table)
827
+                                ->column_clause(prefix => "${table}__");
828
+                push @sql, ',';
829
+            }
830
+            pop @sql if $sql[-1] eq ',';
683 831
         }
684 832
         else {
685
-            $main_table = $tables->[-1] || '';
686
-            foreach my $j (@$join) {
687
-                my $tables = $self->_tables($j);
688
-                foreach my $table (@$tables) {
689
-                    $tables{$table} = 1;
690
-                }
833
+            foreach my $column (@$columns) {
834
+                unshift @$tables, @{$self->_tables($column)};
835
+                push @sql, ($column, ',');
691 836
             }
692
-            delete $tables{$main_table};
693
-        }
694
-        
695
-        # Column clause of main table
696
-        if ($main_table) {
697
-            push @sql, $self->model($main_table)->column_clause;
698
-            push @sql, ',';
699
-        }
700
-        
701
-        # Column cluase of other tables
702
-        foreach my $table (keys %tables) {
703
-            unshift @$tables, $table;
704
-            push @sql, $self->model($table)
705
-                            ->column_clause(prefix => "${table}__");
706
-            push @sql, ',';
707
-        }
708
-        pop @sql if $sql[-1] eq ',';
709
-    }
710
-    
711
-    # Column clause
712
-    elsif (@$columns) {
713
-        foreach my $column (@$columns) {
714
-            unshift @$tables, @{$self->_tables($column)};
715
-            push @sql, ($column, ',');
837
+            pop @sql if $sql[-1] eq ',';
716 838
         }
717
-        pop @sql if $sql[-1] eq ',';
718 839
     }
719 840
     
720 841
     # "*" is default
... ...
@@ -732,9 +853,7 @@ sub select {
732 853
         }
733 854
         else {
734 855
             my $main_table = $tables->[-1] || '';
735
-            push @sql, $self->view($main_table)
736
-                     ? $self->view($main_table)
737
-                     : $main_table;
856
+            push @sql, $main_table;
738 857
         }
739 858
         pop @sql if ($sql[-1] || '') eq ',';
740 859
     }
... ...
@@ -792,7 +911,7 @@ sub select {
792 911
 
793 912
 our %VALID_SELECT_AT_ARGS
794 913
   = map { $_ => 1 } qw/table column where append relation filter query selection
795
-                       param primary_key join all_column/;
914
+                       param primary_key join/;
796 915
 
797 916
 sub select_at {
798 917
     my ($self, %args) = @_;
... ...
@@ -836,92 +955,6 @@ sub select_at {
836 955
     return $self->select(where => $where, %args);
837 956
 }
838 957
 
839
-sub model {
840
-    my ($self, $name, $model) = @_;
841
-    
842
-    # Set
843
-    if ($model) {
844
-        $self->models->{$name} = $model;
845
-        return $self;
846
-    }
847
-    
848
-    # Check model existance
849
-    croak qq{Model "$name" is not included}
850
-      unless $self->models->{$name};
851
-    
852
-    # Get
853
-    return $self->models->{$name};
854
-}
855
-
856
-sub include_model {
857
-    my ($self, $name_space, $model_infos) = @_;
858
-    
859
-    $name_space ||= '';
860
-    unless ($model_infos) {
861
-        # Load name space module
862
-        croak qq{"$name_space" is invalid class name}
863
-          if $name_space =~ /[^\w:]/;
864
-        eval "use $name_space";
865
-        croak qq{Name space module "$name_space.pm" is needed. $@} if $@;
866
-        
867
-        # Search model modules
868
-        my $path = $INC{"$name_space.pm"};
869
-        $path =~ s/\.pm$//;
870
-        opendir my $dh, $path
871
-          or croak qq{Can't open directory "$path": $!};
872
-        $model_infos = [];
873
-        while (my $module = readdir $dh) {
874
-            push @$model_infos, $module
875
-              if $module =~ s/\.pm$//;
876
-        }
877
-        
878
-        close $dh;
879
-    }
880
-    
881
-    foreach my $model_info (@$model_infos) {
882
-        
883
-        # Model class, name, table
884
-        my $model_class;
885
-        my $model_name;
886
-        my $model_table;
887
-        if (ref $model_info eq 'HASH') {
888
-            $model_class = $model_info->{class};
889
-            $model_name  = $model_info->{name};
890
-            $model_table = $model_info->{table};
891
-            
892
-            $model_name  ||= $model_class;
893
-            $model_table ||= $model_name;
894
-        }
895
-        else { $model_class =$model_name = $model_table = $model_info }
896
-        my $mclass = "${name_space}::$model_class";
897
-        
898
-        # Load
899
-        croak qq{"$mclass" is invalid class name}
900
-          if $mclass =~ /[^\w:]/;
901
-        unless ($mclass->can('isa')) {
902
-            eval "use $mclass";
903
-            croak $@ if $@;
904
-        }
905
-        
906
-        # Instantiate
907
-        my $model = $mclass->new(dbi => $self);
908
-        $model->name($model_name) unless $model->name;
909
-        $model->table($model_table) unless $model->table;
910
-        
911
-        # Set
912
-        $self->model($model->name, $model);
913
-        
914
-        # View
915
-        $self->view($model->table, $model->view) if $model->view;
916
-        
917
-        # Apply filter
918
-        croak "${name_space}::$model_class filter must be array reference"
919
-          unless ref $model->filter eq 'ARRAY';
920
-        $self->apply_filter($model->table, @{$model->filter});
921
-    }
922
-    return $self;
923
-}
924
-
925 958
 sub setup_model {
926 959
     my $self = shift;
927 960
     
... ...
@@ -1095,23 +1128,6 @@ sub update_param {
1095 1128
     return join ' ', @tag;
1096 1129
 }
1097 1130
 
1098
-sub view {
1099
-    my $self = shift;
1100
-    my $name = shift;
1101
-    
1102
-    # View
1103
-    $self->{view} ||= {};
1104
-    if (@_) {
1105
-        $self->{view}->{$name} = $_[0];
1106
-        return $self;
1107
-    }
1108
-    else {
1109
-        return $name && $self->{view}->{$name}
1110
-             ? "(" . $self->{view}->{$name} . ") as $name"
1111
-             : undef;
1112
-    }
1113
-}
1114
-
1115 1131
 sub where {
1116 1132
     my $self = shift;
1117 1133
 
... ...
@@ -2211,11 +2227,15 @@ Default is '*' unless C<column> is specified.
2211 2227
     # Default
2212 2228
     $dbi->select(column => '*');
2213 2229
 
2214
-=item C<all_column> EXPERIMENTAL
2230
+You can use hash option in C<column>
2231
+
2232
+=over 4
2233
+
2234
+=item all EXPERIMENTAL
2215 2235
 
2216 2236
 Colum clause, contains all columns of joined table. This is true or false value
2217 2237
 
2218
-    $dbi->select(all_column => 1);
2238
+    $dbi->select(column => {all => 1});
2219 2239
 
2220 2240
 If main table is C<book> and joined table is C<company>,
2221 2241
 This create the following column clause.
... ...
@@ -2234,9 +2254,19 @@ C<columns> attribute is set.
2234 2254
     # Generally do the following way before using all_column option
2235 2255
     $dbi->include_model('MyModel')->setup_model;
2236 2256
 
2237
-You can also specify table names to C<all_column>.
2257
+=item table EXPERIMENTAL
2258
+
2259
+You can also specify table names by C<table> option
2238 2260
 
2239
-    $dbi->select(all_column => ['book', 'company']);
2261
+    $dbi->select(column => {table => ['book', 'company']});
2262
+
2263
+=item prepend EXPERIMENTAL
2264
+
2265
+You can add before created statement
2266
+
2267
+    $dbi->select(column => {prepend => 'SOME', all => 1});
2268
+
2269
+=back
2240 2270
 
2241 2271
 =item C<where>
2242 2272
 
... ...
@@ -2549,27 +2579,6 @@ Create a new L<DBIx::Custom::Where> object.
2549 2579
 Setup all model objects.
2550 2580
 C<columns> of model object is automatically set, parsing database information.
2551 2581
 
2552
-=head2 C<view> EXPERIMENTAL
2553
-
2554
-    # Register view
2555
-    $dbi->view(
2556
-        book_issue_data
2557
-          => 'select id, DATE(issue_datatime) as issue_date from book');
2558
-    );
2559
-    
2560
-    # Get view
2561
-    my $view = $dbi->view('book_issue_date');
2562
-
2563
-View.
2564
-
2565
-C<view()> return the following statement when you get a view.
2566
-
2567
-    (select id, DATE(issue_datetime) from book) as book_issue_date
2568
-
2569
-You can use this view in from clause
2570
-
2571
-    "select issue_date from " . $dbi->view('book_issue_date')
2572
-
2573 2582
 =head1 Tags
2574 2583
 
2575 2584
 The following tags is available.
+59 -7
lib/DBIx/Custom/Model.pm
... ...
@@ -3,7 +3,7 @@ package DBIx::Custom::Model;
3 3
 use strict;
4 4
 use warnings;
5 5
 
6
-use base 'DBIx::Custom';
6
+use base 'Object::Simple';
7 7
 
8 8
 use Carp 'croak';
9 9
 
... ...
@@ -12,12 +12,33 @@ push @DBIx::Custom::CARP_NOT, __PACKAGE__;
12 12
 
13 13
 __PACKAGE__->attr(
14 14
     ['dbi', 'name', 'table', 'view'],
15
+    table_alias => sub { {} },
15 16
     columns => sub { [] },
16 17
     filter => sub { [] },
17 18
     join => sub { [] },
18 19
     primary_key => sub { [] }
19 20
 );
20 21
 
22
+our $AUTOLOAD;
23
+
24
+sub AUTOLOAD {
25
+    my $self = shift;
26
+
27
+    # Method name
28
+    my ($package, $mname) = $AUTOLOAD =~ /^([\w\:]+)\:\:(\w+)$/;
29
+
30
+    # Method
31
+    if (my $dbi_method = $self->dbi->can($mname)) {
32
+        $self->dbi->$dbi_method(@_);
33
+    }
34
+    elsif (my $dbh_method = $self->dbi->dbh->can($mname)) {
35
+        $self->dbi->dbh->$dbh_method(@_);
36
+    }
37
+    else {
38
+        croak qq/Can't locate object method "$mname" via "$package"/
39
+    }
40
+}
41
+
21 42
 sub column_clause {
22 43
     my $self = shift;
23 44
     
... ...
@@ -43,6 +64,38 @@ sub column_clause {
43 64
     return join (', ', @column);
44 65
 }
45 66
 
67
+sub mycolumn {
68
+    my ($self, $columns) = @_;
69
+    
70
+    my $table = $self->table || '';
71
+    $columns ||= $self->columns;
72
+    
73
+    my @column;
74
+    push @column, "$table.$_ as $_" for @$columns;
75
+    
76
+    return join (', ', @column);
77
+}
78
+
79
+sub column {
80
+    my ($self, $table, $columns) = @_;
81
+    
82
+    $self->{_table_alias} ||= {};
83
+    my $dist;
84
+    $dist = $self->dbi->{_table_alias}{$table}
85
+          ? $self->dbi->{_table_alias}{$table}
86
+          : $table;
87
+    
88
+    $self->dbi->{_model_from} ||= {};
89
+    my $model = $self->dbi->{_model_from}->{$dist};
90
+    
91
+    $columns ||= $self->model($model)->columns;
92
+    
93
+    my @column;
94
+    push @column, "$table.$_ as ${table}__$_" for @$columns;
95
+    
96
+    return join (', ', @column);
97
+}
98
+
46 99
 sub delete {
47 100
     my $self = shift;
48 101
     $self->dbi->delete(table => $self->table, @_);
... ...
@@ -110,7 +163,6 @@ sub update_all {
110 163
     $self->dbi->update_all(table => $self->table, @_);
111 164
 }
112 165
 
113
-
114 166
 sub update_at {
115 167
     my $self = shift;
116 168
     
... ...
@@ -147,7 +199,7 @@ L<DBIx::Custom> object.
147 199
     my $dbi = $model->filter
148 200
     $model  = $model->filter({out => 'tp_to_date', in => 'date_to_tp'});
149 201
 
150
-This filter is applied when L<DBIx::Custom> C<include_model()> is called.
202
+This filter is applied when L<DBIx::Custom>'s C<include_model()> is called.
151 203
 
152 204
 =head2 C<name>
153 205
 
... ...
@@ -163,22 +215,22 @@ Model name.
163 215
         ['left outer join company on book.company_id = company.id']
164 216
     );
165 217
     
166
-Default join clause. This is used by C<select()>.
218
+Join clause, this is used as C<select()>'s C<join> option.
167 219
 
168 220
 =head2 C<table>
169 221
 
170 222
     my $table = $model->table;
171 223
     $model    = $model->table('book');
172 224
 
173
-Table name. Model name and table name is different.
174
-Table name is real table name in database.
225
+Table name, this is used as C<select()> C<table> option.
226
+Generally, this is automatically set from class name.
175 227
 
176 228
 =head2 C<primary_key>
177 229
 
178 230
     my $primary_key = $model->primary_key;
179 231
     $model          = $model->primary_key(['id', 'number']);
180 232
 
181
-Foreign key. This is used by C<insert_at>,C<update_at()>,
233
+Foreign key, this is used as C<primary_key> of C<insert_at>,C<update_at()>,
182 234
 C<delete_at()>,C<select_at()>.
183 235
 
184 236
 =head2 C<view>
+47 -18
t/dbix-custom-core-sqlite.t
... ...
@@ -1804,30 +1804,41 @@ $dbi->insert(table => 'table1', param => {key1 => 1, key2 => 2});
1804 1804
 $dbi->insert(table => 'table2', param => {key1 => 1, key3 => 3});
1805 1805
 $model = $dbi->model('table1');
1806 1806
 $result = $model->select_at(
1807
-    all_column => ['table1', 'table2'],
1807
+    column => {table => ['table1', 'table2'], prepend => 'table1.key1 as key1_1,'},
1808 1808
     where => 1
1809 1809
 );
1810 1810
 is_deeply($result->fetch_hash_first,
1811
-          {key1 => 1, key2 => 2, table2__key1 => 1, table2__key3 => 3});
1812
-$result = $model->select(all_column => 1);
1811
+          {key1_1 => 1, key1 => 1, key2 => 2, table2__key1 => 1, table2__key3 => 3});
1812
+$result = $model->select(column => {all => 1});
1813 1813
 is_deeply($result->fetch_hash_first,
1814 1814
           {key1 => 1, key2 => 2, table2__key1 => 1, table2__key3 => 3});
1815 1815
 
1816
-test 'view';
1817
-$dbi = DBIx::Custom->connect($NEW_ARGS->{0});
1816
+test 'mycolumn';
1817
+$dbi = MyDBI8->connect($NEW_ARGS->{0});
1818 1818
 $dbi->execute($CREATE_TABLE->{0});
1819
-$dbi->insert(table => 'table1', param => {key1 => 1, key2 => ' a '});
1820
-$dbi->view('table1_trim' => 'select key1, trim(key2) as key2 from table1');
1821
-$result = $dbi->select(
1822
-    table => 'table1',
1823
-    column => ['table1_trim.key2 as table1_trim__key2'],
1824
-    join => ["left outer join " . $dbi->view('table1_trim') . " on table1.key1 = table1_trim.key1"]
1819
+$dbi->execute($CREATE_TABLE->{2});
1820
+$dbi->setup_model;
1821
+$dbi->insert(table => 'table1', param => {key1 => 1, key2 => 2});
1822
+$dbi->insert(table => 'table2', param => {key1 => 1, key3 => 3});
1823
+$model = $dbi->model('table1');
1824
+$result = $model->select_at(
1825
+    column => [
1826
+        $model->mycolumn,
1827
+        $model->column('table2')
1828
+    ]
1825 1829
 );
1826
-is($result->fetch_hash_first->{'table1_trim__key2'}, 'a');
1827
-
1828
-$result = $dbi->select(table => 'table1_trim');
1829
-is_deeply($result->fetch_hash_first, {key1 => 1, key2 => 'a'});
1830
+is_deeply($result->fetch_hash_first,
1831
+          {key1 => 1, key2 => 2, table2__key1 => 1, table2__key3 => 3});
1832
+$result = $model->select_at(
1833
+    column => [
1834
+        $model->mycolumn(['key1']),
1835
+        $model->column(table2 => ['key1'])
1836
+    ]
1837
+);
1838
+is_deeply($result->fetch_hash_first,
1839
+          {key1 => 1, table2__key1 => 1});
1830 1840
 
1841
+test 'dbi method from model';
1831 1842
 {
1832 1843
     package MyDBI9;
1833 1844
     
... ...
@@ -1843,6 +1854,24 @@ is_deeply($result->fetch_hash_first, {key1 => 1, key2 => 'a'});
1843 1854
 }
1844 1855
 $dbi = MyDBI9->connect($NEW_ARGS->{0});
1845 1856
 $dbi->execute($CREATE_TABLE->{0});
1846
-$dbi->insert(table => 'table1', param => {key1 => 1, key2 => ' a '});
1847
-$result = $dbi->model('table1_trim')->select;
1848
-is_deeply($result->fetch_hash_first, {key1 => 1, key2 => 'a'});
1857
+$model = $dbi->model('table1');
1858
+eval{$model->execute('select * from table1')};
1859
+ok(!$@);
1860
+
1861
+test 'table_alias';
1862
+$dbi = MyDBI9->connect($NEW_ARGS->{0});
1863
+$dbi->execute($CREATE_TABLE->{0});
1864
+$dbi->execute($CREATE_TABLE->{2});
1865
+$dbi->setup_model;
1866
+$dbi->execute('insert into table1 (key1, key2) values (1, 2);');
1867
+$dbi->execute('insert into table2 (key1, key3) values (1, 4);');
1868
+$model = $dbi->model('table1');
1869
+$result = $model->select(
1870
+    column => [
1871
+        $model->column('table2_alias')
1872
+    ],
1873
+    where => {'table2_alias.key3' => 2}
1874
+);
1875
+is_deeply($result->fetch_hash_first, 
1876
+          {table2_alias__key1 => 1, table2_alias__key3 => 48});
1877
+
+5
t/dbix-custom-core-sqlite/MyModel8/table1.pm
... ...
@@ -2,4 +2,9 @@ package MyModel8::table1;
2 2
 
3 3
 use base 'MyModel8';
4 4
 
5
+__PACKAGE__->attr(join => sub { ['left join table2 as table2_alias on table1.key1 = table2_alias.key1'] });
6
+
7
+__PACKAGE__->attr(table_alias => sub { {'table2_alias' => 'table2'} });
8
+
9
+
5 10
 1;
-7
t/dbix-custom-core-sqlite/MyModel8/table1_trim.pm
... ...
@@ -1,7 +0,0 @@
1
-package MyModel8::table1_trim;
2
-
3
-use base 'MyModel8';
4
-
5
-__PACKAGE__->attr(view => 'select key1, trim(key2) as key2 from table1');
6
-
7
-1;
+11
t/dbix-custom-core-sqlite/MyModel8/table2.pm
... ...
@@ -0,0 +1,11 @@
1
+package MyModel8::table2;
2
+
3
+use base 'MyModel8';
4
+
5
+__PACKAGE__->attr(filter => sub {
6
+    [
7
+        key3 => {out => sub { $_[0] * 2}, in => sub { $_[0] * 3}, end => sub { $_[0] * 4 }}
8
+    ]
9
+});
10
+
11
+1;
-1
t/dbix-custom-mysql-private.t
... ...
@@ -96,7 +96,6 @@ $rows = $dbi->select(
96 96
 is_deeply($rows, [{key1 => 1, key2 => 2}]);
97 97
 $dbi->delete_all(table => 'table1');
98 98
 
99
-
100 99
 test 'fork';
101 100
 {
102 101
     $dbi = DBIx::Custom->connect(