PHPackages                             skiptirengu/yii2-mssql-schema - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. skiptirengu/yii2-mssql-schema

ActiveLibrary[Database &amp; ORM](/categories/database)

skiptirengu/yii2-mssql-schema
=============================

Optimized Schema for Yii2 applications using mssql databases

0.6(7y ago)214.9k↓34.7%1[1 issues](https://github.com/skiptirengu/yii2-mssql-schema/issues)[1 PRs](https://github.com/skiptirengu/yii2-mssql-schema/pulls)MITPHPPHP &gt;=5.6.0

Since May 16Pushed 2y ago2 watchersCompare

[ Source](https://github.com/skiptirengu/yii2-mssql-schema)[ Packagist](https://packagist.org/packages/skiptirengu/yii2-mssql-schema)[ RSS](/packages/skiptirengu-yii2-mssql-schema/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (5)Used By (0)

Schema class for Yii2 applications using SQL Server
===================================================

[](#schema-class-for-yii2-applications-using-sql-server)

[![Build Status](https://camo.githubusercontent.com/e7f345dabbd9bfbb37cdeb4de68765722393d30ff9b0a5921bf2e83c4a566d53/68747470733a2f2f7472617669732d63692e6f72672f736b6970746972656e67752f796969322d6d7373716c2d736368656d612e7376673f6272616e63683d6d6173746572)](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
------------

[](#requirements)

- PHP &gt;= 5.6
- SQL Server &gt;= 2008
- PDO driver (pdo\_dblib, pdo\_sqlsrv, etc)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
composer require "skiptirengu/yii2-mssql-schema:*"
```

or add

```
"skiptirengu/yii2-mssql-schema": "*"

```

to the `require` section of your `composer.json` file.

Usage
-----

[](#usage)

To use this extension, just change the database configuration of your application to match the following

```
// ...
'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
----

[](#todo)

- Backport this to PHP 5.4?
- Figure out a way to load table comments

License
-------

[](#license)

Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT license](http://creativecommons.org/licenses/MIT/)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~229 days

Total

3

Last Release

2831d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/98a8cba622cb753034b152931856963f9f6deea67ac8a5d8fa4e80c845eb9fa2?d=identicon)[skiptirengu](/maintainers/skiptirengu)

---

Top Contributors

[![sugiruu](https://avatars.githubusercontent.com/u/5993725?v=4)](https://github.com/sugiruu "sugiruu (5 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

databasemssqlschemasql-serveryii2

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/skiptirengu-yii2-mssql-schema/health.svg)

```
[![Health](https://phpackages.com/badges/skiptirengu-yii2-mssql-schema/health.svg)](https://phpackages.com/packages/skiptirengu-yii2-mssql-schema)
```

###  Alternatives

[yii2tech/illuminate

Yii2 to Laravel Migration Package

11315.1k](/packages/yii2tech-illuminate)[mootensai/yii2-relation-trait

Yii 2 Models load with relation, &amp; transaction save with relation

47220.3k9](/packages/mootensai-yii2-relation-trait)[nhkey/yii2-activerecord-history

Storage history of changes to ActiveRecord

46143.4k1](/packages/nhkey-yii2-activerecord-history)[dmstr/yii2-db

Database extensions

19618.8k6](/packages/dmstr-yii2-db)[urbanindo/yii2-dynamodb

DynamoDB extensions for Yii2

1471.4k](/packages/urbanindo-yii2-dynamodb)[spanjeta/yii2-backup

Database Backup and Restore functionality

285.0k1](/packages/spanjeta-yii2-backup)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
