GithubHelp home page GithubHelp logo

yiisoft / db-mssql Goto Github PK

View Code? Open in Web Editor NEW
25.0 22.0 13.0 679 KB

MSSQL Server driver for Yii Database

Home Page: https://www.yiiframework.com/

License: BSD 3-Clause "New" or "Revised" License

PHP 91.92% TSQL 8.08%
mssql yii3 database dbal query-builder sql sql-server

db-mssql's Introduction

Yii MSSQL

Yii Database MSSQL Server driver


Latest Stable Version Total Downloads rector codecov StyleCI

MSSQL Server driver for Yii Database is a package for working with MSSQL databases in PHP.

The package provides a set of classes for connecting to a MSSQL database, creating and executing commands, and working with data. It also includes a set of tools for building and executing queries, including support for parameter binding, as well as tools for working with transactions.

To use it, you will need to have the PHP MSSQL extension installed and enabled on your server. You will also need to have access to a SQL Server database and the necessary credentials to connect to it.

Support version

PHP MSSQL Version CI-Actions
8.0 - 8.2 2017 - 2022 build Mutation testing badge static analysis type-coverage

Installation

The package could be installed with Composer:

composer require yiisoft/db-mssql

Documentation

To configure connection to MSSQL database check Connecting MSSQL.

Check the documentation docs to learn about usage.

If you need help or have a question, the Yii Forum is a good place for that. You may also check out other Yii Community Resources.

License

The Yii Database MSSQL Server driver is free software. It is released under the terms of the BSD License. Please see LICENSE for more information.

Maintained by Yii Software.

Support the project

Open Collective

Follow updates

Official website Twitter Telegram Facebook Slack

db-mssql's People

Contributors

darkdef avatar dependabot-preview[bot] avatar dependabot[bot] avatar devanych avatar hoaaah avatar luizcmarin avatar machour avatar roxblnfk avatar rustamwin avatar samdark avatar stylecibot avatar terabytesoftw avatar tigrov avatar viktorprogger avatar vjik avatar xepozz 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

Watchers

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

db-mssql's Issues

Wrong solution for multiple access to DB

return $this->query('SELECT CAST(COALESCE(SCOPE_IDENTITY(), @@IDENTITY) AS bigint)')->fetchColumn();
- it's work only for standalone users:
Example: 2 managers work with base and begin multiple insert into DB. This method return last inserted id, instead id of your new record.
For correct work need something like this:

$id = $this->query("SELECT IDENT_CURRENT('{$table}')")->fetchColumn();
$this->exec('INSERT INTO {$table} (name) VALUES ('blabla')');
return $this->query("SELECT {$pk} FROM {$table} WHERE name='blabla' AND {$pk} > {$id}")->fetchColumn();

I need help to understand how to use this package

I am using Yii2.0.14, php 3.5 and have a mssql database but I don't know which driver or how to proceed to use it. As of this package... I couldn't find any documentation that can help one understand what is it for and how to use it.

Thanks.

I cant install - Help!

Additional info

Q A
Yii version 2.0.16
PHP version 7.2
Operating system Win 10

Showing this...

yiisoft/core 3.0.x-dev requires psr/container-implementation ^1.0 -> no matching package found.

Add mssql\Schema character_maximum_length support

We use mainly MSSQL and do have some trouble with the max-length of some fields. We have to add manually the string max rules, to avoid ugly DB errors.

So I thought it would be handy to just add this to the yii\db\mssql\Schema, so it would be automatically used by Gii to create the models.

Fix behavior for output inserted

Need remove returning all inserted data from query builder and return only primary key.
For simple query, returning id without temporary table.

Unable to install with the composer instructions

What steps will reproduce the problem?

composer require --prefer-dist yiisoft/yii2-mssql "~1.0.0"

What's expected?

What do you get instead?

Could not find a matching version of package yiisoft/yii2-mssql. Check the package spelling, your version constraint and that the package is availa
ble in a stability which matches your minimum-stability (stable).

Additional info

Q A
Yii version 2.?
Yii MSSQL version
MSSQL Server version
PHP version 7.2
Operating system Debian or Microsoft Windows 10

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.