-- ======================================================================= --
-- Enum 
-- ======================================================================= --

{-

mysql-sql> create table data_type_enum (my_enum enum('aaa', 'bbb', 'ccc'));
Query OK, 0 rows affected (0.06 sec)
mysql-sql> insert into data_type_enum values ('ddd');
Query OK, 1 row affected, 1 warning (0.01 sec)
Warning (code 1265): Data truncated for column 'my_enum' at row 1
mysql-sql> select * from data_type_enum;
+---------+
| my_enum |
+---------+
|         |
+---------+
1 row in set (0.00 sec)
mysql-sql> insert into data_type_enum values ('aaa');
Query OK, 1 row affected (0.00 sec)
mysql-sql> select * from data_type_enum;
+---------+
| my_enum |
+---------+
|         |
| aaa     |
+---------+
2 rows in set (0.00 sec)
mysql-sql> delete from data_type_enum;
Query OK, 2 rows affected (0.01 sec)
mysql-sql> insert into data_type_enum values ('bbb');
Query OK, 1 row affected (0.01 sec)
mysql-sql> select * from data_type_enum;
+---------+
| my_enum |
+---------+
| bbb     |
+---------+
1 row in set (0.00 sec)
mysql-sql>

-}

example07_01 :: IO ()
example07_01 = do
  putStrLn "start example07_01"
  nodeSess <- openNodeSession $ defaultNodeSesssionInfo {database = "x_protocol_test", user = "root", password="root"}

  (meta, ret@(x:xs)) <- executeRawSqlMetaData "select * from data_type_enum limit 1" nodeSess

  print meta
  print ret 
  print $ (BL.length (Seq.index x 0) )

  return ()
example07_01 :: IO ()
example07_01 = do
  putStrLn "start example07_01"
  nodeSess <- openNodeSession $ defaultNodeSesssionInfo {database = "x_protocol_test", user = "root", password="root"}

  (meta, ret@(x:xs)) <- executeRawSqlMetaData "select * from data_type_enum limit 1" nodeSess

  print meta
  print ret 
  print $ (BL.length (Seq.index x 0) )

  return ()
example07_01 = do
  putStrLn "start example07_01"
  nodeSess <- openNodeSession $ defaultNodeSesssionInfo {database = "x_protocol_test", user = "root", password="root"}

  (meta, ret@(x:xs)) <- executeRawSqlMetaData "select * from data_type_enum limit 1" nodeSess

  print meta
  print ret 
  print $ (BL.length (Seq.index x 0) )

  return ()