Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/skiptirengu/yii2-mssql-schema
Optimized Schema for Yii2 applications using SQL Server databases
https://github.com/skiptirengu/yii2-mssql-schema
database mssql schema sql-server yii2
Last synced: 3 months ago
JSON representation
Optimized Schema for Yii2 applications using SQL Server databases
- Host: GitHub
- URL: https://github.com/skiptirengu/yii2-mssql-schema
- Owner: skiptirengu
- License: mit
- Created: 2017-05-10T16:26:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-31T17:34:52.000Z (over 1 year ago)
- Last Synced: 2024-10-04T20:20:36.028Z (3 months ago)
- Topics: database, mssql, schema, sql-server, yii2
- Language: PHP
- Homepage:
- Size: 69.3 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Schema class for Yii2 applications using SQL Server
[![Build Status](https://travis-ci.org/skiptirengu/yii2-mssql-schema.svg?branch=master)](https://travis-ci.org/skiptirengu/yii2-mssql-schema)
This extension provides an optimized Schema class for Yii2 applications using SQL Server databases,
and also fixes several bugs of the current core mssql implementation.It achieves a better performance by using the stored procedure [sp_help](https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-help-transact-sql) instead of querying the system catalog for each table you're acessing. This cuts down the number of queries Yii executes to get information about your table from three to only **one**!
Requirements
------------+ PHP >= 5.6
+ SQL Server >= 2008
+ PDO driver (pdo_dblib, pdo_sqlsrv, etc)Installation
------------The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Either run
```bash
composer require "skiptirengu/yii2-mssql-schema:*"
```or add
```
"skiptirengu/yii2-mssql-schema": "*"
```to the `require` section of your `composer.json` file.
Usage
-----To use this extension, just change the database configuration of your application to match the following
```php
// ...
'components' => [
'db' => [
'class' => 'yii\db\Connection',
// ...
'schemaMap' => [
// if you're using freetds + dblib
'dblib' => 'skiptirengu\mssql\Schema',
// older MSSQL driver on MS Windows hosts
'mssql' => 'skiptirengu\mssql\Schema',
// new ms driver for SQL Server
// https://github.com/Microsoft/msphpsql
'sqlsrv' => 'skiptirengu\mssql\Schema',
]
]
]
```and you're set!
TODO
----
+ Backport this to PHP 5.4?
+ Figure out a way to load table commentsLicense
-------Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT license](http://creativecommons.org/licenses/MIT/)