xp-framework / rdbms Goto Github PK
View Code? Open in Web Editor NEWRDBMS support for the XP Framework: MySQL, Sybase, MSSQL, PostgreSQL, SQLite3, Interbase
RDBMS support for the XP Framework: MySQL, Sybase, MSSQL, PostgreSQL, SQLite3, Interbase
When creating dataset classes with the framework's generator the primary keys doesn't get detected for postgresql databases. Therefore no getBy() methods are created and after saving a new row the value of the auto increment column remains unset in the object.
The tableAttributeFrom function in rdbms.mysqli.MySQLiDBAdapter
enforces the Type of a record to have a length. For example the type text
does not have this field, so it fails with
Uncaught exception: Exception lang.IndexOutOfBoundsException (Undefined offset: 3)
at <main>::__error(8, (0x13)'Undefined offset: 3', (0x69)'/home/idev/dev/temp/codegen/vendor/xp-framework/rdbms/src/main/p', 108, array[2]) [line 108 of MySQLiDBAdapter.class.php]
In the MySQL implementation this is fixed with a default value
public static function tableAttributeFrom($record) {
preg_match('#^([a-z]+)(\(([0-9,]+)\))?#', $record['Type'], $regs);
return new DBTableAttribute(
$record['Field'], // name
self::$map[$regs[1]], // type
false !== strpos($record['Extra'], 'auto_increment'), // identity
!(empty($record['Null']) || ('NO' == $record['Null'])), // nullable
(int)(isset($regs[3]) ? $regs[3] : 0), // length
0, // precision
0 // scale
);
}
The rdbms.unittest.mock
package has been picked by several of our libraries to emulate certain result sets.
With the current location with the mock package being within src/test
, a library cannot pick it any more. Should we expose it to src/main
, possibly as rdbms.mock
package?
This this()
core functionality was removed in XP 6.6.0
The connection should be reset when packet no. out of order as the connection is unusable!
*** Exception rdbms.SQLStatementFailedException (errorcode -1: Packet no. out of order, have 0, expecting 1
*** Exception rdbms.SQLStatementFailedException (errorcode -1: Packet no. out of order, have 35, expecting 1)
See https://travis-ci.org/xp-framework/rdbms/jobs/135264912:
F unittest.TestWarning(test= rdbms.unittest.integration.MySQLIntegrationTest::connectFailedThrowsException, time= 0.134 seconds) {
[""mysql_connect(): Access denied for user 'wrong-user'@'localhost' (using password: YES)" in mysqli::hh_real_connect() (, line 0, occured once)"]
}
ร: 45/104 run (59 skipped), 44 succeeded, 1 failed
Memory used: 2048.00 kB (2048.00 kB peak)
Time taken: 5.856 seconds
Use Traversable
, see https://wiki.php.net/rfc/internal_method_return_types
[line 66 of .\vendor\xp-framework\rdbms\src\main\php\rdbms\DBConnection.class.php]
PHP 8.0+
In commit 1101dca, all of the sqlite package was removed in favor of the sqlite3 package. That package, however, does not have an SQLiteDBAdapter, so we cannot do reflection on these kinds of databases any more.
Furthermore, we're now having an unresolved dependency in xp.codegen.dataset.Generator
.
I suggest to extract the removed class from the referenced commit and add it to the sqlite3 package.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.