Protos, Tables, More Fun

« previous entry | next entry »
Aug. 13th, 2008 | 04:26 pm

Here is an example of using protobuf on table definitions for Drizzle:

[brian@piggy serialize]$ ./table_reader example_table.frm
CREATE TABLE `example_table` (
	`sample0` VARCHAR(83),
	`sample1` VARCHAR(86) CHARACTER SET utf8 COLLATE utf8_swedish_ci NOT NULL ,
	`sample2` VARCHAR(77) CHARACTER SET utf8 COLLATE utf8_swedish_ci,
	`number` INTEGER ,
	`colors` ENUM('red','blue','green') ,
	`some_btye_string` BLOB ,
	`important_number` DECIMAL(8,3) ,
	`important_string` VARCHAR(20),
	 PRIMARY KEY (`number`),
	 UNIQUE KEY `sample0` (`sample0`),
	 UNIQUE KEY `sample1` (`sample1`)
)
  ENGINE = Innodb;

[brian@piggy serialize]$ du example_table.frm
4	example_table.frm



The size is very reasonable, and descriptive code is much, much smaller then before.

What else is sharp? Extending the definition for new objects is now cake.

Bye, Bye crummy if/else/version/garbage.

Link | Leave a comment | Share

Comments {1}

Kevac Marko

(no subject)

from: mkevac
date: Aug. 24th, 2008 04:48 am (UTC)
Link

PB are great, but it's pity that it does not work with pure c language.

Reply | Thread