Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a sequence options #354

Open
nikklass opened this issue Sep 24, 2017 · 3 comments
Open

Creating a sequence options #354

nikklass opened this issue Sep 24, 2017 · 3 comments

Comments

@nikklass
Copy link

nikklass commented Sep 24, 2017

Hi,

Thanks for the package. I wud like to create a sequence with more options than the example given. Is it possible to create a sequence

create sequence MY_TEST_SEQ
minvalue -2147483648
maxvalue -00001
start with -00001
increment by -1
nocache;

I have tried the following, but it seems some options dont exist:

$sequence->create('MY_TEST_SEQ', $start = -00001, $min = -2147483648, $max = -00001, $increment = -1, $nocache = true);

System details

  • Operating System - macos Sierra
  • PHP Version - PHP 7.0.22
  • Laravel Version - 5.4
  • Laravel-OCI8 Version - 5.4.*

Thanks.

@nikklass
Copy link
Author

Why dont you offer some of these functions like create() in sequence as traits so that we can easily override/ customize them if needed?

@nikklass
Copy link
Author

You cud add the option i suppose like you currently do in Sequence.php:

public function create($name, $start = 1, $nocache = false, $min = 1, $max = 10000, $increment = 1)
    {
        if (! $name) {
            return false;
        }

        $nocache = $nocache ? 'nocache' : '';

        $sequence_stmt = "create sequence {$name} minvalue {$min} maxvalue {$max} start with {$start} increment by {$increment} {$nocache}";

        return $this->connection->statement($sequence_stmt);

    }

Rgds.

@mstaack
Copy link
Collaborator

mstaack commented Sep 25, 2017

@nikklass we are open for pull-requests 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants