| 1 | # ABSTRACT SQL Simple Operations Commands | ||
| 2 | # | ||
| 3 | ## LICENSE AND COPYRIGHT | ||
| 4 | # | ||
| 5 | ## Copyright (C) Carlos Celso | ||
| 6 | # | ||
| 7 | ## This program is free software: you can redistribute it and/or modify | ||
| 8 | ## it under the terms of the GNU General Public License as published by | ||
| 9 | ## the Free Software Foundation, either version 3 of the License, or | ||
| 10 | ## (at your option) any later version. | ||
| 11 | # | ||
| 12 | ## This program is distributed in the hope that it will be useful, | ||
| 13 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | ## GNU General Public License for more details. | ||
| 16 | # | ||
| 17 | ## You should have received a copy of the GNU General Public License | ||
| 18 | ## along with this program. If not, see L<http://www.gnu.org/licenses/>. | ||
| 19 | # | ||
| 20 | |||
| 21 | ## NOTE: The plugin is NOT REQUIRED for standard DBI connectors | ||
| 22 | # | ||
| 23 | ## Use the plugin for required condition to pre/post module calls. | ||
| 24 | # | ||
| 25 | |||
| 26 | package SQL::SimpleOps::DBI::MyPlugin; | ||
| 27 | |||
| 28 | use 5.006001; | ||
| 29 | use strict; | ||
| 30 | use warnings; | ||
| 31 | use Exporter; | ||
| 32 | |||
| 33 | our @ISA = qw ( Exporter ); | ||
| 34 | |||
| 35 | our @EXPORT = qw(new Open Select SelectCursor Delete Insert Update Call $VERSION); | ||
| 36 | |||
| 37 | our $VERSION = "2026.129.1"; | ||
| 38 | |||
| 39 | our @EXPORT_OK = @EXPORT; | ||
| 40 | |||
| 41 | our %EXPORT_TAGS = ( all => [@EXPORT_OK] ); | ||
| 42 | 1; | ||
| 43 | |||
| 44 | ############################################################################### | ||
| 45 | ## plugin initialization | ||
| 46 | |||
| 47 | sub new() | ||
| 48 | { | ||
| 49 | my $class = shift; $class = ref($class) || $class || 'SQL::SimpleOps::DBI::MyPlugin'; | ||
| 50 | my $self = {@_}; | ||
| 51 | |||
| 52 | # give my plugin name | ||
| 53 | $self->{sql_simple}->{init}{plugin_id} = "MyPlugin"; | ||
| 54 | |||
| 55 | # use '1' if your db have schema option format | ||
| 56 | $self->{sql_simple}->{init}{schema} = 0; | ||
| 57 | |||
| 58 | # use '1' if your args must have server/tcport values | ||
| 59 | $self->{sql_simple}->{init}{test_server} = 1; | ||
| 60 | |||
| 61 | # use '1' if between your field/alias infomation have 'as' value | ||
| 62 | $self->{sql_simple}->{init}{alias_with_as} = 0; | ||
| 63 | |||
| 64 | bless($self,$class); | ||
| 65 | } | ||
| 66 | |||
| 67 | ############################################################################### | ||
| 68 | ## initialize here the dsname by: | ||
| 69 | # | ||
| 70 | ## All methods can be executed using the format: | ||
| 71 | # $self_sql_simple->[method_name](); | ||
| 72 | # | ||
| 73 | ## return codes: | ||
| 74 | ## rc=0 ok, continue | ||
| 75 | ## rc<1 syntax, abort | ||
| 76 | ## rc=1 error, abort | ||
| 77 | ## rc=2 ok, ignore caller | ||
| 78 | |||
| 79 | sub Open() | ||
| 80 | { | ||
| 81 | my $self = shift; | ||
| 82 | my $argv = shift; | ||
| 83 | |||
| 84 | ## sets the dsnam here | ||
| 85 | ## $self->{sql_simple}->{argv}{dsname} = ... | ||
| 86 | |||
| 87 | return 0; | ||
| 88 | } | ||
| 89 | sub Select() | ||
| 90 | { | ||
| 91 | my $self = shift; | ||
| 92 | my $argv = shift; | ||
| 93 | return 0; | ||
| 94 | } | ||
| 95 | sub SelectCursor() | ||
| 96 | { | ||
| 97 | my $self = shift; | ||
| 98 | my $argv = shift; | ||
| 99 | return 0; | ||
| 100 | } | ||
| 101 | sub Delete() | ||
| 102 | { | ||
| 103 | my $self = shift; | ||
| 104 | my $argv = shift; | ||
| 105 | return 0; | ||
| 106 | } | ||
| 107 | sub Update() | ||
| 108 | { | ||
| 109 | my $self = shift; | ||
| 110 | my $argv = shift; | ||
| 111 | return 0; | ||
| 112 | } | ||
| 113 | sub Call() | ||
| 114 | { | ||
| 115 | my $self = shift; | ||
| 116 | my $argv = shift; | ||
| 117 | return 0; | ||
| 118 | } | ||
| 119 | |||
| 120 | sub PreFetch() | ||
| 121 | { | ||
| 122 | my $self = shift; | ||
| 123 | my $argv = shift; | ||
| 124 | return 0; | ||
| 125 | } | ||
| 126 | |||
| 127 | __END__ |