File tree Expand file tree Collapse file tree 6 files changed +7
-65
lines changed Expand file tree Collapse file tree 6 files changed +7
-65
lines changed Original file line number Diff line number Diff line change @@ -88,24 +88,4 @@ public function accepts_limit_and_order_for_update_and_delete(): bool
88
88
{
89
89
return true ;
90
90
}
91
-
92
- /**
93
- * @return array<string, string|array<string, mixed>>
94
- */
95
- public function native_database_types (): array
96
- {
97
- return [
98
- 'primary_key ' => 'int(11) UNSIGNED DEFAULT NULL auto_increment PRIMARY KEY ' ,
99
- 'string ' => ['name ' => 'varchar ' , 'length ' => 255 ],
100
- 'text ' => ['name ' => 'text ' ],
101
- 'integer ' => ['name ' => 'int ' , 'length ' => 11 ],
102
- 'float ' => ['name ' => 'float ' ],
103
- 'datetime ' => ['name ' => 'datetime ' ],
104
- 'timestamp ' => ['name ' => 'datetime ' ],
105
- 'time ' => ['name ' => 'time ' ],
106
- 'date ' => ['name ' => 'date ' ],
107
- 'binary ' => ['name ' => 'blob ' ],
108
- 'boolean ' => ['name ' => 'tinyint ' , 'length ' => 1 ]
109
- ];
110
- }
111
91
}
Original file line number Diff line number Diff line change @@ -135,21 +135,4 @@ public function set_encoding(string $charset): void
135
135
{
136
136
$ this ->query ("SET NAMES ' $ charset' " );
137
137
}
138
-
139
- public function native_database_types (): array
140
- {
141
- return [
142
- 'primary_key ' => 'serial primary key ' ,
143
- 'string ' => ['name ' => 'character varying ' , 'length ' => 255 ],
144
- 'text ' => ['name ' => 'text ' ],
145
- 'integer ' => ['name ' => 'integer ' ],
146
- 'float ' => ['name ' => 'float ' ],
147
- 'datetime ' => ['name ' => 'datetime ' ],
148
- 'timestamp ' => ['name ' => 'timestamp ' ],
149
- 'time ' => ['name ' => 'time ' ],
150
- 'date ' => ['name ' => 'date ' ],
151
- 'binary ' => ['name ' => 'binary ' ],
152
- 'boolean ' => ['name ' => 'boolean ' ]
153
- ];
154
- }
155
138
}
Original file line number Diff line number Diff line change @@ -108,22 +108,4 @@ public function accepts_limit_and_order_for_update_and_delete(): bool
108
108
{
109
109
return true ;
110
110
}
111
-
112
- public function native_database_types (): array
113
- {
114
- return [
115
- 'primary_key ' => 'integer not null primary key ' ,
116
- 'string ' => ['name ' => 'varchar ' , 'length ' => 255 ],
117
- 'text ' => ['name ' => 'text ' ],
118
- 'integer ' => ['name ' => 'integer ' ],
119
- 'float ' => ['name ' => 'float ' ],
120
- 'decimal ' => ['name ' => 'decimal ' ],
121
- 'datetime ' => ['name ' => 'datetime ' ],
122
- 'timestamp ' => ['name ' => 'datetime ' ],
123
- 'time ' => ['name ' => 'time ' ],
124
- 'date ' => ['name ' => 'date ' ],
125
- 'binary ' => ['name ' => 'blob ' ],
126
- 'boolean ' => ['name ' => 'boolean ' ]
127
- ];
128
- }
129
111
}
Original file line number Diff line number Diff line change @@ -563,15 +563,6 @@ abstract public function query_for_tables(): \PDOStatement;
563
563
*/
564
564
abstract public function set_encoding (string $ charset ): void ;
565
565
566
- /*
567
- * Returns an array mapping of native database types
568
- */
569
-
570
- /**
571
- * @return array<string, string|array<string, mixed>>
572
- */
573
- abstract public function native_database_types (): array ;
574
-
575
566
/**
576
567
* Specifies whether adapter can use LIMIT/ORDER clauses with DELETE & UPDATE operations
577
568
*
Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ public function reestablish_connection(bool $close = true): Connection
133
133
$ connection = $ this ->class ->getStaticPropertyValue ('connection ' , null );
134
134
135
135
if ($ close ) {
136
- ConnectionManager::drop_connection ($ connection );
136
+ ConnectionManager::drop_connection ($ connection ?? '' );
137
137
static ::clear_cache ();
138
138
}
139
139
Original file line number Diff line number Diff line change @@ -74,4 +74,10 @@ public function testEncoding()
74
74
$ info = ActiveRecord \Connection::parse_connection_url ('mysql://test:test@127.0.0.1/test?charset=utf8 ' );
75
75
$ this ->assertEquals ('utf8 ' , $ info ['charset ' ]);
76
76
}
77
+
78
+ public function testReestablishConnection ()
79
+ {
80
+ $ connection = \test \models \Book::reestablish_connection (true );
81
+ $ this ->assertNotNull ($ connection );
82
+ }
77
83
}
You can’t perform that action at this time.
0 commit comments