Giter Site home page Giter Site logo

auraphp / aura.sqlschema Goto Github PK

View Code? Open in Web Editor NEW
41.0 14.0 14.0 458 KB

Independent schema discovery tools for MySQL, PostgreSQL, SQLite, and Microsoft SQL Server.

License: BSD 2-Clause "Simplified" License

PHP 100.00%
aura database php pdo sql

aura.sqlschema's People

Contributors

arabcoders avatar fale avatar harikt avatar henriquemoody avatar iansltx avatar jakejohns avatar maxakawizard avatar mindplay-dk avatar nyamsprod avatar pborreli avatar ptarjan avatar ramirovarandas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aura.sqlschema's Issues

Doc is wrong about the constructor

The doc affirms:

$schema = new MysqlSchema($pdo);

while in the source the __constructor is:

public function __construct(PDO $pdo, ColumnFactory $column_factory)

so it will always be an error, since no ColumnFactory is provided.
The error is:

PHP Catchable fatal error:  Argument 2 passed to Aura\Sql_Schema\AbstractSchema::__construct() must be an instance of Aura\Sql_Schema\ColumnFactory, none given, called in /home/fale/sql2md/src/sql2json.php on line 17 and defined in /home/fale/sql2md/vendor/aura/sql-schema/src/AbstractSchema.php on line 69

Fatal error under 5.3

Composer.json specifies 5.3 compatibility, but a fatal error is thrown under 5.3:

Fatal error: Can't inherit abstract function Aura\SqlSchema\SchemaInterface::fetchTableList() (previously declared abstract in Aura\SqlSchema\AbstractSchema) in C:\...\sqlschema\src\AbstractSchema.php on line 23

I'm going to suggest removing the abstract methods in AbstractSchema - the same methods (and documentation) are already defined in SchemaInterface, so they are redundant to begin with. The abstract class isn't required to complete the interface in the first place, and doesn't complete it by adding abstract methods anyway, since abstract methods are basically just an anonymous interface embedded in an abstract class...

Automatic db type discovery

Add functionality to discover the database type (from the connection string for example) and use the apropriate methods to list tables, fields, indexes automatically - so there is no need to create driver-specific classes. Thanks.

Fetch Microsoft SQL Server table by dot notation

Being able to fetch a table by dot notation.

I am using sqlsrv.

Sometimes my connection is set to use ex. table "global.dbo.some_table" and when it is set to this, which is perfectly valid, it unfortunately fails to retrieve the colums.

on renaming

Hi guys,

This is regarding the renaming discussion happening at

https://groups.google.com/d/msg/auraphp/JNnklDBaGnU/kKG2MoC8Jm0J

I noticed @cordoval 's work on https://github.com/cordoval/random-packagist-test/blob/master/composer.json#L3 .

So I feel it is good to have a composer.json in Aura.Sql_Schema with

{
    "name": "aura/sql-query",
    "replace": {
        "aura/sqlquery": "no-sure on version"
    }
}

So the new package aura/sqlquery can be found by the old one aura/sql-query .
If you guys have any insights on this it will be great help. / cc @simensen

Thank you.

Made changes to my fork of this repo to make it compatible with PHP 8.1

I have been using this package in some applications running in a PHP 7.4 environment. When I upgraded to PHP 8.1 and ran the applications I got the following deprecation warnings:

PHP Deprecated:  strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in C:\SoftwareProjects\test-php-project\vendor\aura\sqlschema\src\MysqlSchema.php on line 121

Deprecated: strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in C:\SoftwareProjects\test-php-project\vendor\aura\sqlschema\src\MysqlSchema.php on line 121
PHP Deprecated:  strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in C:\SoftwareProjects\test-php-project\vendor\aura\sqlschema\src\MysqlSchema.php on line 121

Deprecated: strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in C:\SoftwareProjects\test-php-project\vendor\aura\sqlschema\src\MysqlSchema.php on line 121
PHP Deprecated:  strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in C:\SoftwareProjects\test-php-project\vendor\aura\sqlschema\src\MysqlSchema.php on line 121

Deprecated: strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in C:\SoftwareProjects\test-php-project\vendor\aura\sqlschema\src\MysqlSchema.php on line 121
PHP Deprecated:  strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in C:\SoftwareProjects\test-php-project\vendor\aura\sqlschema\src\MysqlSchema.php on line 121

Deprecated: strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in C:\SoftwareProjects\test-php-project\vendor\aura\sqlschema\src\MysqlSchema.php on line 121
PHP Deprecated:  strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in C:\SoftwareProjects\test-php-project\vendor\aura\sqlschema\src\MysqlSchema.php on line 121

Deprecated: strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in C:\SoftwareProjects\test-php-project\vendor\aura\sqlschema\src\MysqlSchema.php on line 121
PHP Deprecated:  strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in C:\SoftwareProjects\test-php-project\vendor\aura\sqlschema\src\MysqlSchema.php on line 121

Deprecated: strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in C:\SoftwareProjects\test-php-project\vendor\aura\sqlschema\src\MysqlSchema.php on line 121
PHP Deprecated:  strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in C:\SoftwareProjects\test-php-project\vendor\aura\sqlschema\src\MysqlSchema.php on line 121

Deprecated: strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in C:\SoftwareProjects\test-php-project\vendor\aura\sqlschema\src\MysqlSchema.php on line 121
PHP Deprecated:  strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in C:\SoftwareProjects\test-php-project\vendor\aura\sqlschema\src\MysqlSchema.php on line 121

Deprecated: strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in C:\SoftwareProjects\test-php-project\vendor\aura\sqlschema\src\MysqlSchema.php on line 121

So I decided to fork this project and created a new branch rotexsoft/Aura.SqlSchema@2.x...3.0.1 in my fork that makes the code compatible with PHP 8.1 & also made it support mariadb & Postgres (which doesn't work on the latest version 2.0.3). Details of the changes I made can be found here https://github.com/rotexdegba/Aura.SqlSchema/releases

If accepted, these changes should be merged into a 3.x branch and a new 3.0.0 major release should be created.

Looking forward to hearing back from you.

If I don't hear back by the end of this week (Sunday Feb 11, 2024), I will just go ahead to create a new package on packagist from my fork & just adjust the namespaces, because I really need these changes in an application that I will be updating to PHP 8.1 in production. I have tried to look for an email address for Paul Jones or Hari K T but couldn't find any and I could not post to the Google group it seems to have posting disabled or maybe because I just joined the group.

Thanks.

Missing table reflection

Table reflection is missing - we need a table model to reflect things like comments on tables, storage types, and whatever other table metadata each storage engine might provide.

This will be a BC break, since tables are currently reflected as strings, so there is no existing table model we can flesh out with these properties.

Add functionality to alter/update existing database schema

I'd like to be able to have a database/table schema defined in some type of config file.

Then I'd like to use Sql_Schema to compare the existing database schema with the new schema in my config file.

I would then like to be able to use the comparison to build the database queries needed to update the database schema to my new schema and pass it to something similar to __toString(), which can be passed to PDO or ExtendedPdo.

I am prepared to create my own library to do this, but wanted to know if this would fit in the domain of what Sql_Schema does. Or should this go into another library, like Sql_SchemaManager?

What do you think?

I'd be happy to send PR's if you'd like.

What is the future of this project?

What is the future of this project? In my opinion, it is feature complete and only needs to have the latest versions of PHP (7.3, 7.4 & 8.0 as of this writing) tested via travis or Github Actions to ensure it continues to work with the currently supported version of PHP. Will anyone be updating the CI tests for this project?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.