Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Composer Issue #74

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
463e8d8
support-sequence
sim1984 Oct 9, 2016
523a799
Change readme
sim1984 Oct 9, 2016
d882813
change readme
sim1984 Oct 9, 2016
74696d3
change readme
sim1984 Oct 9, 2016
86768f8
change readme
sim1984 Oct 9, 2016
1c78106
spelling
sim1984 Oct 9, 2016
5a49c15
change readme
sim1984 Oct 9, 2016
fa2d249
change composer
sim1984 Oct 9, 2016
b05088c
fix readme
sim1984 Oct 9, 2016
c04ab51
fix composer.json
sim1984 Oct 9, 2016
95cf162
change composer
sim1984 Oct 9, 2016
effcff3
change composer
sim1984 Oct 9, 2016
4a56f45
fix composer
sim1984 Oct 9, 2016
8350791
fix composer
sim1984 Oct 9, 2016
fe645f2
composer
sim1984 Oct 9, 2016
25be318
fix composer
sim1984 Oct 9, 2016
3dede75
fix composer
sim1984 Oct 9, 2016
8b9904a
fix composer
sim1984 Oct 9, 2016
b57c29c
fix
sim1984 Oct 9, 2016
25f8078
Fix RETURNING
sim1984 Mar 26, 2017
2eb7c7c
Fix RETURNING clause in README
sim1984 Mar 26, 2017
762050b
Simplify the ServiceProvider
sim1984 Nov 29, 2017
a899d56
Update composer.json
fesoft Aug 1, 2018
508309a
Merge pull request #1 from fesoft/patch-1
sim1984 Aug 1, 2018
a4ae9ee
Update for Laravel 5.5 support
sim1984 Oct 20, 2018
89b6d6b
Редактировать сообщение для коммита
sim1984 Oct 20, 2018
ca82502
rr
sim1984 Oct 20, 2018
cf22563
Merge branch 'master' of https://github.com/sim1984/laravel-firebird
sim1984 Oct 20, 2018
c33989f
update version
sim1984 Oct 20, 2018
c47f4c3
laravel 5.7
sim1984 Aug 9, 2019
b3a372f
nbproject remove
sim1984 Aug 9, 2019
e1b5f6b
Update .gitignore
sim1984 Aug 9, 2019
fb7bc16
version support
douglasresendemaciel Apr 28, 2020
28e4fbf
Merge pull request #3 from douglasresendemaciel/master
sim1984 Aug 18, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.DS_Store
.*.sw?
.idea
/nbproject
141 changes: 120 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# laravel-firebird
laravel-firebird
================

To use this package:

Expand All @@ -11,45 +12,143 @@ Mariuz's Blog has a very good step by step on this:
http://mapopa.blogspot.com/2009/04/php5-and-firebird-pdo-on-ubuntu-hardy.html

Install using composer:
```json
composer require jacquestvanzuydam/laravel-firebird
```

**For Laravel 5.1.* support, please look at the [5.1-support](https://github.com/jacquestvanzuydam/laravel-firebird/tree/5.1-support) branch.**

**For Laravel 5.2.* support, please look at the [5.2-sup](https://github.com/jacquestvanzuydam/laravel-firebird/tree/5.2-sup) branch.**

**For Laravel 5.3.* support, pleast look at the [5.3-support](https://github.com/jacquestvanzuydam/laravel-firebird/tree/5.3-support) branch.**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ json
composer require sim1984/laravel-firebird
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Update the `app/config/app.php`, add the service provider:
```json

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ json
'Firebird\FirebirdServiceProvider'.
```
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can remove the original DatabaseServiceProvider, as the original connection factory has also been extended.
For Laravel 5.7 and later:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ php
Firebird\FirebirdServiceProvider::class,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can remove the original DatabaseServiceProvider, as the original connection
factory has also been extended.

Declare your connection in the database config, using 'firebird' as the
connecion type.
Other keys that are needed:
```php
connecion type. Other keys that are needed:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ php
'firebird' => [
'driver' => 'firebird',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE','/storage/firebird/APPLICATION.FDB'),
'username' => env('DB_USERNAME', 'sysdba'),
'password' => env('DB_PASSWORD', 'masterkey'),
'charset' => env('DB_CHARSET', 'UTF8'),
'role' => 'RDB$ADMIN',
'engine_version' => '3.0.4',
],
```
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

And add to your .env
```

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DB_CHARSET=UTF8
```
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If necessary, change the UTF8 to any other charset

This package is still in it's infancy and I wouldn't yet recommend using
it for large projects, or without backing up your database regularly.
This package is a branch jacquestvanzuydam/laravel-firebird package and extends
its functionality. Tested on Laravel-5.7.

Added the following features:

- Added support for direct control sequences in

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ php
// CREATE SEQUENCE "seq_users_id"
Schema::createSequence('seq_users_id');

// ALTER SEQUENCE "seq_users_id" RESTART WITH 10 INCREMENT BY 5
Schema::sequence('seq_users_id', function (SequenceBlueprint $sequence) {
$sequence->increment(5);
$sequence->restart(10);
});

// DROP SEQUENCE "seq_users_id"
Schema::dropSequence('seq_users_id');
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- The implementation of auto-increment columns in two ways:

- through the automatic generation of sequences and before insert trigger

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ php
// CREATE TABLE "users" (
// "id" INTEGER NOT NULL PRIMARY KEY,
// "name" VARCHAR(255) NOT NULL,
// "email" VARCHAR(255) NOT NULL,
// "password" VARCHAR(255) NOT NULL,
// "remember_token" VARCHAR(100),
// "created_at" TIMESTAMP,
// "updated_at" TIMESTAMP
// );
// ALTER TABLE "users" ADD PRIMARY KEY ("id");
// ALTER TABLE "users" ADD CONSTRAINT "users_email_unique" UNIQUE ("email");
// CREATE SEQUENCE "seq_users";
// CREATE OR ALTER TRIGGER "tr_users_bi" FOR "users"
// ACTIVE BEFORE INSERT
// AS
// BEGIN
// IF (NEW."id" IS NULL) THEN
// NEW."id" = NEXT VALUE FOR "seq_users";
// END
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});

// DROP TABLE "users";
// DROP SEQUENCE "seq_users";
Schema::drop('users');
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- using identity fields (only in Firebird 3.0).

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ php
// CREATE TABLE "users" (
// "id" INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
// "name" VARCHAR(255) NOT NULL,
// "email" VARCHAR(255) NOT NULL,
// "password" VARCHAR(255) NOT NULL,
// "remember_token" VARCHAR(100),
// "created_at" TIMESTAMP,
// "updated_at" TIMESTAMP
// );
// ALTER TABLE "users" ADD CONSTRAINT "users_email_unique" UNIQUE ("email");
Schema::create('users', function (Blueprint $table) {
$table->useIdentity(); // only Firebird 3.0
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- The implementation of InsertGetId method is similar to the postgres, ie
using RETURNING proposal.

- Create your own base model class in which insertAndSetId method is
implemented through the prior receipt by the sequence identifier.

- Added additional methods for the execution of stored procedures and stored
functions.

- Added Providing the connection parameters: the name of the role and Firebird
version (to use the correct grammar).

Any comments or contributions are welcome.
 
27 changes: 17 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
{
"name": "jacquestvanzuydam/laravel-firebird",
"name": "sim_1984/laravel-firebird",
"description": "A Firebird database package for the Laravel Framework",
"license": "MIT",
"version": "1.0.0.0",
"version": "1.0.3",
"authors": [
{
"name": "Jacques van Zuydam",
"email": "[email protected]"
},
{
"name": "Simonov Denis",
"email": "[email protected]"
}
],
"prefer-stable": true,
"minimum-stability": "dev",
"require": {
"php": ">=5.4.0",
"illuminate/support": "5.0.*",
"illuminate/container": "5.0.*",
"illuminate/database": "5.0.*",
"illuminate/events": "5.0.*"
"php": "^7.1.3",
"ext-pdo": "*",
"illuminate/support": "5.7.*",
"illuminate/container": "5.7.*",
"illuminate/database": "5.7.*",
"illuminate/events": "5.7.*",
"doctrine/instantiator": "~1.0.3"
},
"autoload":{
"psr-0": {
"Firebird\\": "src/"
}
"psr-0": {
"Firebird\\": "src/"
}
}
}
Loading