Last active
August 29, 2015 14:05
-
-
Save do-aki/d91584e38efd9f844d30 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$grn = grn_ctx_init(); | |
grn_ctx_connect($grn, "localhost", 10043); | |
grn_ctx_send($grn, "table_create Site TABLE_HASH_KEY ShortText"); | |
grn_ctx_recv($grn); | |
grn_ctx_send($grn, "column_create Site title COLUMN_SCALAR ShortText"); | |
grn_ctx_recv($grn); | |
grn_ctx_send($grn, 'load --table Names --values [{\"_key\":\"aaa\",\"name\":\"name1\"},{\"_key\":\"bbb\",\"name\":\"name2\"}]'); | |
grn_ctx_recv($grn); | |
grn_ctx_send($grn, "select Site --query id:1"); | |
$r = grn_ctx_recv($grn); | |
var_dump($r); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
array(1) { | |
[0] => array(2) { | |
[0] => int(0) | |
[1] => string(120) "[[[1],[["_id","UInt32"],["_key","ShortText"],["title","ShortText"]],[1,"http://example.org/","This is test record 1!"]]]" | |
} | |
} | |
=========================================================== | |
[ | |
[ | |
[1], | |
[ | |
["_id","UInt32"], | |
["_key","ShortText"], | |
["title","ShortText"] | |
], | |
[1,"http://example.org/","This is test record 1!"] | |
] | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment