2016-08-18

tclcubrid v0.3

Source code:
tclcubrid


About:

CUBRID is an open source SQL-based relational database management system with object extensions developed by Naver Corporation for web applications.

tclcubrid is a Tcl extension by using CUBRID CCI (CCI Client Interface) driver to connect CUBRID. I write this extension to research CUBRID and CCI (CCI Client Interface) driver.


Main changelog:

  1. Add sequence type support
  2. Add set type support


嘗試加入更多 type 的支援。

2016-08-17

tclcubrid v0.2

Source code:
tclcubrid


About:

CUBRID is an open source SQL-based relational database management system with object extensions developed by Naver Corporation for web applications.

tclcubrid is a Tcl extension by using CUBRID CCI (CCI Client Interface) driver to connect CUBRID. I write this extension to research CUBRID and CCI (CCI Client Interface) driver.


Main changelog:
  1. Using cci_connect_ex to replace cci_connect_3_0 method
  2. Add monetary type support
  3. Add enum type support


替換使用的 method,改為使用 cci_connect_ex。並且嘗試加入更多 type 的支援。

2016-08-15

tclmonetdb v0.7.7

Homepage


tclmonetdb

About


tclmonetdb is a Tcl extension by using MAPI library to connect MonetDB.

一些說明


  1. Update README.md
  2. Cleanup code
只是清理掉一些不需要的註解和 code,然後更新 README.md 的說明。

2016-08-05

Tcl extension for CUBRID database: tclcubrid

Source code:
tclcubrid


About:

CUBRID is an open source SQL-based relational database management system with object extensions developed by Naver Corporation for web applications.

tclcubrid is a Tcl extension by using CUBRID CCI (CCI Client Interface) driver to connect CUBRID. I write this extension to research CUBRID and CCI (CCI Client Interface) driver.


這是開發中的早期版本,而且沒有進行比較完整的測試,比較簡單的功能已經可以使用,但是 BLOB/CLOB 我不知道怎麼樣簡化會比較好,所以目前並不支援。

使用 CUBRID 10.0 在 openSUSE LEAP 42.1 上測試。


2016/08/06
加入實驗性質的 CLOB/BLOB 支援,大小限制為 65536

2016/08/07
加入 TDBC interface

2016/08/10
移除 bit/varbit 的支援,改寫法以後,結果還是一樣不正確。
所以我移除掉 bit/varbit 的支援。

更新 CLOB/BLOB 大小限制為 131072。

2016/08/11
更新 bind 所使用的 type 名稱,讓使用的名稱與 TDBC 更接近。
int -> integer
short -> smallint

我知道我在哪裡犯錯了,重新加回 bit/varbit 的支援。

2016/08/12
Github 上建立第一個 tag,版本號碼為 0.1。

2016-07-28

Tcl/Tk 8.6.6 RELEASED

Tcl/Tk 8.6.6 RELEASED


下面是更新的總結:

Summary of Changes since Tcl/Tk 8.6.5:
------------------------------


This is a patch release, so it primarily includes bug fixes and corrections
to erratic behavior.  Highlighted changes are noted below.  The changes file
at the root of the source tree contains a more complete list.  The Timelines
of all changes are online.

        http://core.tcl.tk/tcl/
        http://core.tcl.tk/tk/

    * [TIP 443] More configuration options for text tags.

    * [TIP 446] [$text edit (canundo|canredo)].

    * Update to Unicode 9.0.
         *** POTENTIAL INCOMPATIBILITY ***

    * Final newline in [text] handling restored compat with 8.6.4 and
before.
         *** POTENTIAL INCOMPATIBILITY ***

    * [file] support for more Windows filesystem conventions.
[5d7ca0,ae61a6]
         *** POTENTIAL INCOMPATIBILITY ***

    * [namespace upvar $ns] now ignores custom resolvers in $ns.
         *** POTENTIAL INCOMPATIBILITY ***

    * Tcl_WrongNumArgs() now uses proper list formatting in error message.
      Matters when parameter names contain spaces, etc.
         *** POTENTIAL INCOMPATIBILITY ***

    * Fixed crashes or hangs in...
       - [apply {{} {foreach x y {if 1 break else}}}]
       - compiled [string replace]
       - notifier finalization
       - server socket creation on Win
       - [glob -path a]
       - Tcl_DString appends to self
       - mouse pointer warping
       - Aqua geometry calculations on new toplevel
       - zlib-8.17, zlib-8.18
       - apply {{} {lassign {} item; dict update item item item two two {}}}
       - [vwait] after namespace delete destroys variable waited on.

    * Fix: Safe handling of widget destruction during callbacks.

    * Fix: compiled [lreplace $list end ...].
         *** POTENTIAL INCOMPATIBILITY ***

    * Fix: circumstances of command callbacks from [scale].

    * Fix: Stop event firing from hidden panes of panedwindow.

    * Fix: <<Modified>> delivery to text peers.

    * Win: Mouse events in exposed window after double click in file dialog.

    * Improve support for text bindings customization.

    * Improved performance scaling of [namespace delete].

    * Xft color font speed.

    * Restored support for TclBlend.

    * tcltest -relateddir processing in sorted order

    * Aqua appearance fixes.

    * Updated bundled packages
       - tcltest 2.4.0: (TIP 447) execution time verbosity option
       - registry 1.3.2:
       - Itcl 4.0.5
       - Thread 2.8.0
       - sqlite 3.13.0

2016-07-12

Build Casstcl on openSUSE LEAP 42.1 (64bit)

下載 Cassandra C++ driver source code 以後,在解壓縮的根目錄下,修改 CMakeLists.txt 的內容, 因為要加入 openSUSE 的資料。
    elseif(EXISTS "/etc/redhat-release" OR EXISTS "/etc/fedora-release" OR
           EXISTS "/etc/slackware-version" OR EXISTS "/etc/gentoo-release" OR
           EXISTS "/etc/os-release")
      if(CMAKE_SIZEOF_VOID_P EQUAL 8)
        set (CMAKE_INSTALL_LIBDIR "lib64")
      else()
        set (CMAKE_INSTALL_LIBDIR "lib")
      endif()

(* 我有送出一個 pull request 被接受了,所以接下來的版本可能可以不用修改這裡)

Cassandra C++ driver 需要 libuv-devel 和 Open SSL 有安裝才能正確編譯。

建立一個 build 的目錄,然後使用下面的命令建立 Makefile (for openSUSE 64bit):
cmake -DCMAKE_INSTALL_PREFIX=/usr  ..

再來就是 make 與 make install: 
make
sudo make install

下面就是測試的 C++ 程式:
#include <cassandra.h>
#include <stdio.h>

int main() {
  /* Setup and connect to cluster */
  CassFuture* connect_future = NULL;
  CassCluster* cluster = cass_cluster_new();
  CassSession* session = cass_session_new();

  /* Add contact points */
  cass_cluster_set_contact_points(cluster, "127.0.0.1");

  /* Provide the cluster object as configuration to connect the session */
  connect_future = cass_session_connect(session, cluster);

  if (cass_future_error_code(connect_future) == CASS_OK) {
    CassFuture* close_future = NULL;

    /* Build statement and execute query */
    CassStatement* statement
      = cass_statement_new("SELECT keyspace_name "
                           "FROM system_schema.keyspaces", 0);

    CassFuture* result_future = cass_session_execute(session, statement);

    if(cass_future_error_code(result_future) == CASS_OK) {
      /* Retrieve result set and iterate over the rows */
      const CassResult* result = cass_future_get_result(result_future);
      CassIterator* rows = cass_iterator_from_result(result);

      while(cass_iterator_next(rows)) {
        const CassRow* row = cass_iterator_get_row(rows);
        const CassValue* value = cass_row_get_column_by_name(row, "keyspace_name");

        const char* keyspace;
        size_t keyspace_length;
        cass_value_get_string(value, &keyspace, &keyspace_length);
        printf("keyspace_name: '%.*s'\n",
               (int)keyspace_length, keyspace);
      }

      cass_result_free(result);
      cass_iterator_free(rows);
    } else {
      /* Handle error */
      const char* message;
      size_t message_length;
      cass_future_error_message(result_future, &message, &message_length);
      fprintf(stderr, "Unable to run query: '%.*s'\n",
              (int)message_length, message);
    }

    cass_statement_free(statement);
    cass_future_free(result_future);

    /* Close the session */
    close_future = cass_session_close(session);
    cass_future_wait(close_future);
    cass_future_free(close_future);
  } else {
    /* Handle error */
    const char* message;
    size_t message_length;
    cass_future_error_message(connect_future, &message, &message_length);
    fprintf(stderr, "Unable to connect: '%.*s'\n",
            (int)message_length, message);
  }

  cass_future_free(connect_future);
  cass_cluster_free(cluster);
  cass_session_free(session);

  return 0;
}

注意,system_schema.keyspaces 在 3.x 之前,需要使用 system.schema_keyspaces 才行 (CASSANDRA-6717)。

因為 Tcl driver 建立在 CPP driver 之上,所以接下來是在 openSUSE 64bit 環境安裝 Tcl driver。

下面是 build 的命令:

autoconf
./configure --enable-64bit --libdir=/usr/lib64/tcl
make
sudo make install

如果成功的話,就可以使用 casstcl 這個套件來存取 Apache Cassandra。

下面是一個範例:

package require casstcl

set cass [::casstcl::connect -host 127.0.0.1 -port 9042]
$cass select "SELECT keyspace_name FROM system_schema.keyspaces;" row {
  parray row
}
$cass delete

目前 casstcl 在 prepared statement 使用 ? 做 parameters binding,需要在第一次使用 exec 前呼叫 reimport_column_type_map,執行的結果才會是正確的(更正:或者是在 create table 之後,因為新增的 table 還沒有對應資料)。

2016-07-07

tcljsonnet v0.4

首頁:
tcljsonnet


主要更新:
將 Jsonnet code base 版本升到 v0.8.9 版。

2016-06-15

TkCVS

TkCVS


因為需要在 Linux 環境中有一個簡易的 SVN 介面,所以下載 TkCVS 來使用。稍微看了一下,我發現是使用呼叫 svn command line tool 然後讀取結果的方法。

下面是 source code 的片段:
  set commandline "svn log -g -l 1"
  set ret [catch {eval "exec $commandline"} output]

很有趣的做法。

2016-05-30

tclmonetdb v0.7.6

Homepage


tclmonetdb

About


tclmonetdb is a Tcl extension by using MAPI library to connect MonetDB.

一些說明


  1. Update README.md
  2. Improve STMT_HANDLE fetch_field command
 這是個小更新的版本,增加 fetch_field 對於 NULL 的處理。

2016-05-26

GeodeREST v0.1: Apache Geode REST Client Library for Tcl

Hompage


GeodeREST: Apache Geode REST Client Library for Tcl

About

Apache Geode provides a database-like consistency model, reliable transaction processing and a shared-nothing architecture to maintain very low latency performance with high concurrency processing.

This extension is an Apache Geode REST Client Library for Tcl. The library consists of a single Tcl Module file.

一些說明

目前有二個方式可以從 Tcl 存取 Apache Geode,一個是利用 memcached interface (memcached-for-Tcl),一個則是 REST interface。

這個 Tcl extension 試著利用 Apache Geode REST interface 存取資料。