-
Notifications
You must be signed in to change notification settings - Fork 6
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
rqlite (sqlite raft consensus) #17
Comments
Hey - thanks for your interest. I think that's a pretty interesting idea. I would think a possible direction to go would be to add another DB adapter, e.g. |
Recently found a good package to use for rqlite. Would you consider integrating this into popdb if I did a pull request? |
Probably not. It looks like it has its own ecosystem for adapters, results, etc. I'd be more interested in just building out an rqlite adapter using the Pop HTTP client, while leveraging the existing DB ecosystem in Pop DB. |
Hi @nicksagona, still working on the rqlite adapter. Just got an error while using TypeError Pop\Db\Sql\PredicateSet::equalTo(): Argument #2 ($value) must be of type string, null given, called in src/Gateway/Row.php on line 244. What might it mean? |
Is the <?php
require_once __DIR__ . '/../vendor/autoload.php';
use Pop\Db\Db;
use Pop\Db\Record;
class User extends Record
{
}
Record::setDb(Db::sqliteConnect([
'database' => __DIR__ . '/tmp/popdb.sqlite',
]));
$user = new User([
'username' => 'admin',
'email' => '[email protected]',
]);
$user->save();
$user = User::findById(1);
print_r($user->toArray()); Will print out:
|
Still getting the same issue. Please see my code here.
Trace: 0: () at src/Sql/PredicateSet.php:211
1: Pop\Db\Sql\PredicateSet->equalTo() at src/Gateway/Row.php:244
2: Pop\Db\Gateway\Row->find() at src/Record.php:576
3: Pop\Db\Record->getById() at src/Record.php:296
4: Pop\Db\Record::findById() at eval()'d code:1 |
@nicksagona solved the issue. The files below reference different adapters, so I added rqlite. src/Sql/AbstractSql.php
src/Sql/Schema.php
src/Sql/Select.php |
Hi @nicksagona, I was wondering is you could change Example: $u = new User(["username"=>"nick", email=>"[email protected]"]);
$u->save();// Does an INSERT
$u = User::findById(1);
$u->save();// Does an UPDATE
$u = new User;
$u->username = "sagona";
$u->email = "[email protected]"
$u->save();// Does and UPDATE instead of INSERT. Also gets an error. See below: Pop\Db\Gateway\Exception Error: The value of '0' is not set. |
Hi @nicksagona, After some contemplation I've decided I can do this externally without affecting You can have a look at it here. I think you may close this "issue" at this point. Thanks, much appreciated. |
Hi,
Hope you are well. Just like to first of all say I enjoy using pop framework.
This is more of a suggestion rather than an issue.
Raft consensus for sqlite is coming up quite well as a trend.
The problem is that they do not allow writing directly to the database but via a REST API so as to allow distribution.
How can this be accommodated in pop-db ?
The text was updated successfully, but these errors were encountered: