Git Product home page Git Product logo

Comments (4)

SergejJurecko avatar SergejJurecko commented on June 12, 2024

What are you using to connect to ActorDB?

from actordb.

catroot avatar catroot commented on June 12, 2024

actordb_console -u root

actordb> s
****************************************************************************************************************************************************************
sql                                                                                                                                                 type       |
----------------------------------------------------------------------------------------------------------------------------------------------------------------
$CREATE TABLE tab (id INTEGER PRIMARY KEY, txt TEXT);                                                                                               type1      |
$CREATE TABLE tab1 (id INTEGER PRIMARY KEY, txt TEXT);                                                                                              type1      |
$ALTER TABLE tab ADD i INTEGER;                                                                                                                     type1      |
$CREATE TABLE tabx (id INTEGER PRIMARY KEY CHECK (typeof(id) == 'integer'), txt TEXT CHECK (typeof(id) == 'text'));                                 type1      |
$CREATE TABLE asdf (id INTEGER PRIMARY KEY AUTOINCREMENT, txt BLOB);                                                                                type2      |
$CREATE TABLE actors (id TEXT PRIMARY KEY, hash INTEGER, val INTEGER) WITHOUT ROWID;                                                                counters   |
$CREATE TABLE actors (id TEXT PRIMARY KEY, hash INTEGER, size INTEGER)  WITHOUT ROWID;                                                              filesystem |
$CREATE TABLE users (id INTEGER PRIMARY KEY AUTOINCREMENT, fileid TEXT, uid INTEGER, FOREIGN KEY (fileid) REFERENCES actors(id) ON DELETE CASCADE); filesystem |
----------------------------------------------------------------------------------------------------------------------------------------------------------------

PS
i've got this work:

actordb> actor type1(test) create;
actordb (1)> SELECT name FROM sqlite_master WHERE type='table';
actordb (2)> c
****************
name           |
----------------
__transactions |
__adb          |
tab            |
tab1           |
tabx           |
----------------

And this:

actordb> actor type1(test) create;
actordb (1)> PRAGMA table_info([tab]);
actordb (2)> c
****************************************
cid dflt_value name notnull pk type    |
----------------------------------------
0   null       id   0       1  INTEGER |
1   null       txt  0       0  TEXT    |
2   null       i    0       0  INTEGER |
----------------------------------------

from actordb.

SergejJurecko avatar SergejJurecko commented on June 12, 2024

The thrift interface has functions: actor_types, actor_tables, actor_columns

For the SQL interface, the correct query is:

actor filesystem(1);
SELECT name FROM sqlite_master WHERE type='table';

setting * for actor name means running query across all shards (multi actor query). Setting it to 1 (or any simple word) will mean sending query to a single shard.

Multi actor queries require {{RESULT}} variable. Running this:

actor filesystem(*);
{{RESULT}}SELECT name FROM sqlite_master WHERE type='table';

Will return a much bigger result and have an additional column "actor".

from actordb.

catroot avatar catroot commented on June 12, 2024

Thank you.

from actordb.

Related Issues (20)

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.