Skip to content

Instantly share code, notes, and snippets.

@do-aki
Last active August 29, 2015 14:05
Show Gist options
  • Save do-aki/b855f211f5a301f60920 to your computer and use it in GitHub Desktop.
Save do-aki/b855f211f5a301f60920 to your computer and use it in GitHub Desktop.
<?php
$ctx = grn_get_default_ctx(); // grn_ctx_open(0)
$db = grn_db_open_or_create($ctx, '/tmp/db');
$table = grn_table_open_or_create(
$ctx,
'Site',
null, // path
GRN_TABLE_HASH_KEY,
grn_ctx_at($ctx, GRN_DB_SHORT_TEXT)
);
grn_column_open_or_create(
$table,
'title',
null, // path
0, // flags
grn_ctx_at($ctx, GRN_DB_SHORT_TEXT)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment