1DBIx::Class::Storage::DUBsIe:r:OCroanctlrei:bD:uBGtIeexnd:e:rPCielcra(ls3s)D:o:cSutmoernatgaet:i:oDnBI::Oracle::Generic(3)
2
3
4

NAME

6       DBIx::Class::Storage::DBI::Oracle::Generic - Oracle Support for
7       DBIx::Class
8

SYNOPSIS

10         # In your result (table) classes
11         use base 'DBIx::Class::Core';
12         __PACKAGE__->add_columns({ id => { sequence => 'mysequence', auto_nextval => 1 } });
13         __PACKAGE__->set_primary_key('id');
14
15         # Somewhere in your Code
16         # add some data to a table with a hierarchical relationship
17         $schema->resultset('Person')->create ({
18               firstname => 'foo',
19               lastname => 'bar',
20               children => [
21                   {
22                       firstname => 'child1',
23                       lastname => 'bar',
24                       children => [
25                           {
26                               firstname => 'grandchild',
27                               lastname => 'bar',
28                           }
29                       ],
30                   },
31                   {
32                       firstname => 'child2',
33                       lastname => 'bar',
34                   },
35               ],
36           });
37
38         # select from the hierarchical relationship
39         my $rs = $schema->resultset('Person')->search({},
40           {
41             'start_with' => { 'firstname' => 'foo', 'lastname' => 'bar' },
42             'connect_by' => { 'parentid' => { '-prior' => { -ident => 'personid' } },
43             'order_siblings_by' => { -asc => 'name' },
44           };
45         );
46
47         # this will select the whole tree starting from person "foo bar", creating
48         # following query:
49         # SELECT
50         #     me.persionid me.firstname, me.lastname, me.parentid
51         # FROM
52         #     person me
53         # START WITH
54         #     firstname = 'foo' and lastname = 'bar'
55         # CONNECT BY
56         #     parentid = prior personid
57         # ORDER SIBLINGS BY
58         #     firstname ASC
59

DESCRIPTION

61       This class implements base Oracle support. The subclass
62       DBIx::Class::Storage::DBI::Oracle::WhereJoins is for "(+)" joins in
63       Oracle versions before 9.0.
64

METHODS

66   get_autoinc_seq
67       Returns the sequence name for an autoincrement column
68
69   datetime_parser_type
70       This sets the proper DateTime::Format module for use with
71       DBIx::Class::InflateColumn::DateTime.
72
73   connect_call_datetime_setup
74       Used as:
75
76           on_connect_call => 'datetime_setup'
77
78       In connect_info to set the session nls date, and timestamp values for
79       use with DBIx::Class::InflateColumn::DateTime and the necessary
80       environment variables for DateTime::Format::Oracle, which is used by
81       it.
82
83       Maximum allowable precision is used, unless the environment variables
84       have already been set.
85
86       These are the defaults used:
87
88         $ENV{NLS_DATE_FORMAT}         ||= 'YYYY-MM-DD HH24:MI:SS';
89         $ENV{NLS_TIMESTAMP_FORMAT}    ||= 'YYYY-MM-DD HH24:MI:SS.FF';
90         $ENV{NLS_TIMESTAMP_TZ_FORMAT} ||= 'YYYY-MM-DD HH24:MI:SS.FF TZHTZM';
91
92       To get more than second precision with
93       DBIx::Class::InflateColumn::DateTime for your timestamps, use something
94       like this:
95
96         use Time::HiRes 'time';
97         my $ts = DateTime->from_epoch(epoch => time);
98
99   relname_to_table_alias
100       DBIx::Class uses DBIx::Class::Relationship names as table aliases in
101       queries.
102
103       Unfortunately, Oracle doesn't support identifiers over 30 chars in
104       length, so the DBIx::Class::Relationship name is shortened and appended
105       with half of an MD5 hash.
106
107       See "relname_to_table_alias" in DBIx::Class::Storage::DBI.
108
109   with_deferred_fk_checks
110       Runs a coderef between:
111
112         alter session set constraints = deferred
113         ...
114         alter session set constraints = immediate
115
116       to defer foreign key checks.
117
118       Constraints must be declared "DEFERRABLE" for this to work.
119

ATTRIBUTES

121       Following additional attributes can be used in resultsets.
122
123   connect_by or connect_by_nocycle
124       Value: \%connect_by
125
126       A hashref of conditions used to specify the relationship between parent
127       rows and child rows of the hierarchy.
128
129         connect_by => { parentid => 'prior personid' }
130
131         # adds a connect by statement to the query:
132         # SELECT
133         #     me.persionid me.firstname, me.lastname, me.parentid
134         # FROM
135         #     person me
136         # CONNECT BY
137         #     parentid = prior persionid
138
139
140         connect_by_nocycle => { parentid => 'prior personid' }
141
142         # adds a connect by statement to the query:
143         # SELECT
144         #     me.persionid me.firstname, me.lastname, me.parentid
145         # FROM
146         #     person me
147         # CONNECT BY NOCYCLE
148         #     parentid = prior persionid
149
150   start_with
151       Value: \%condition
152
153       A hashref of conditions which specify the root row(s) of the hierarchy.
154
155       It uses the same syntax as "search" in DBIx::Class::ResultSet
156
157         start_with => { firstname => 'Foo', lastname => 'Bar' }
158
159         # SELECT
160         #     me.persionid me.firstname, me.lastname, me.parentid
161         # FROM
162         #     person me
163         # START WITH
164         #     firstname = 'foo' and lastname = 'bar'
165         # CONNECT BY
166         #     parentid = prior persionid
167
168   order_siblings_by
169       Value: ($order_siblings_by | \@order_siblings_by)
170
171       Which column(s) to order the siblings by.
172
173       It uses the same syntax as "order_by" in DBIx::Class::ResultSet
174
175         'order_siblings_by' => 'firstname ASC'
176
177         # SELECT
178         #     me.persionid me.firstname, me.lastname, me.parentid
179         # FROM
180         #     person me
181         # CONNECT BY
182         #     parentid = prior persionid
183         # ORDER SIBLINGS BY
184         #     firstname ASC
185

FURTHER QUESTIONS?

187       Check the list of additional DBIC resources.
188
190       This module is free software copyright by the DBIx::Class (DBIC)
191       authors. You can redistribute it and/or modify it under the same terms
192       as the DBIx::Class library.
193
194
195
196perl v5.34.0                     D2B0I2x2:-:0C1l-a2s1s::Storage::DBI::Oracle::Generic(3)
Impressum