ATSLIB/contrib/mysql/mysql

This package contains an API for programming mysql in ATS.


  • MYSQLptr
  • MYSQLptr0
  • MYSQLptr1
  • MYSQLRESptr
  • MYSQLRESptr0
  • MYSQLRESptr1
  • MYSQLFIELDptr
  • MYSQLFIELDptr0
  • MYSQLFIELDptr1
  • MYSQLROW
  • MYSQLROW0
  • MYSQLROW1
  • mysql_init
  • mysql_init0
  • mysql_init0_exn
  • mysql_init1
  • mysql_close
  • mysql_real_connect
  • mysql_change_user
  • mysql_ping
  • mysql_query
  • mysql_list_dbs
  • mysql_list_fields
  • mysql_field_count
  • mysql_num_rows
  • mysql_num_fields
  • mysql_field_tell
  • mysql_field_seek
  • mysql_affected_rows
  • mysql_use_result
  • mysql_store_result
  • mysql_free_result
  • mysql_data_seek
  • mysql_fetch_row
  • mysql_unfetch_row
  • mysql_fetch_lengths
  • mysql_unfetch_lengths
  • mysqlrow_get_at
  • mysqlrowlen_get_at
  • mysql_fetch_field
  • mysql_unfetch_field
  • mysql_fetch_field_direct
  • mysql_fetch_fields
  • mysqlfield_get_name
  • mysqlfield_get_length
  • mysqlfield_get_max_length
  • mysql_info
  • mysql_stat
  • mysql_sqlstate
  • mysql_get_host_info
  • mysql_get_proto_info
  • mysql_get_server_info
  • mysql_get_server_version
  • mysql_get_client_info
  • mysql_get_client_version
  • mysql_errno
  • mysql_error
  • mysql_hex_string
  • mysql_escape_string
  • mysql_real_escape_string
  • fprint_mysqlres
  • fprint_mysqlres$sep1
  • fprint_mysqlres$sep2
  • fprint_mysqlres_sep
  • fprint_mysqlrow
  • fprint_mysqlrow$sep
  • fprint_mysqlrow_sep
  • Overloaded Symbols
  • ptrcast
  • fprint

  • MYSQLptr

    Synopsis

    absvtype MYSQLptr (l:addr) = ptr

    MYSQLptr0

    Synopsis

    vtypedef MYSQLptr0 = [l:addr] MYSQLptr (l)

    MYSQLptr1

    Synopsis

    vtypedef MYSQLptr1 = [l:addr| l > null] MYSQLptr (l)

    MYSQLRESptr

    Synopsis

    absvtype MYSQLRESptr (l:addr) = ptr

    MYSQLRESptr0

    Synopsis

    vtypedef MYSQLRESptr0 = [l:addr] MYSQLRESptr (l)

    MYSQLRESptr1

    Synopsis

    vtypedef MYSQLRESptr1 = [l:addr| l > null] MYSQLRESptr (l)

    MYSQLFIELDptr

    Synopsis

    absvtype MYSQLFIELDptr (l1:addr, l2:addr) = ptr

    MYSQLFIELDptr0

    Synopsis

    vtypedef
    MYSQLFIELDptr0 (l1:addr) = [l2:addr] MYSQLFIELDptr (l1, l2)

    MYSQLFIELDptr1

    Synopsis

    vtypedef
    MYSQLFIELDptr1 (l1:addr) = [l2:addr| l2 > null] MYSQLFIELDptr (l1, l2)

    MYSQLROW

    Synopsis

    absvtype MYSQLROW (l1:addr, l2:addr) = ptr

    MYSQLROW0

    Synopsis

    vtypedef
    MYSQLROW0 (l1:addr) = [l2:addr] MYSQLROW (l1, l2)

    MYSQLROW1

    Synopsis

    vtypedef
    MYSQLROW1 (l1:addr) = [l2:addr| l2 > null] MYSQLROW (l1, l2)

    mysql_init

    Synopsis

    overload mysql_init with mysql_init0
    overload mysql_init with mysql_init1

    mysql_init0

    Synopsis

    fun mysql_init0 ((*null*)): MYSQLptr0 = "mac#%"

    mysql_init0_exn

    Synopsis

    fun mysql_init0_exn ((*null*)): MYSQLptr1 = "mac#%"

    mysql_init1

    Synopsis

    fun mysql_init1 {l:agz} (x: !MYSQLptr (l)): ptr (l) = "mac#%"

    mysql_close

    Synopsis

    fun mysql_close (x: MYSQLptr0): void = "mac#%"

    mysql_real_connect

    Synopsis

    fun
    mysql_real_connect
      {l:agz} (
      mysql: !MYSQLptr (l)
    , host: NSH(stropt)
    , user: NSH(stropt)
    , passwd: NSH(stropt)
    , dbname: NSH(stropt)
    , port: uint
    , socket: NSH(stropt)
    , clientflag: ulint
    ) : Ptrnull (l) = "mac#%"

    mysql_change_user

    Synopsis

    fun
    mysql_change_user
      {l:agz} (
      mysql: !MYSQLptr l
    , user: NSH(string)
    , passwd: NSH(stropt)
    , dbname: NSH(stropt)
    ) : int(*bool*) = "mac#%"

    mysql_ping

    Synopsis

    fun mysql_ping (mysql: !MYSQLptr1): int = "mac#%"

    mysql_query

    Synopsis

    fun mysql_query
      (mysql: !MYSQLptr1, q: query): int(*err*) = "mac#%"

    mysql_list_dbs

    Synopsis

    fun mysql_list_dbs
      {l:agz} (
      mysql: !MYSQLptr l, wild: NSH(stropt)
    ) : MYSQLRESptr0 = "mac#%" // endfun

    mysql_list_fields

    Synopsis

    fun mysql_list_fields
      {l:agz} (
      mysql: !MYSQLptr l
    , table: NSH(string), wild: NSH(stropt)
    ) : MYSQLRESptr0 = "mac#%" // endfun

    mysql_field_count

    Synopsis

    fun mysql_field_count (mysql: !MYSQLptr1): uint = "mac#%"

    mysql_num_rows

    Synopsis

    fun mysql_num_rows
      {l:agz} (
      res: !MYSQLRESptr l
    ) : [n:nat] (MYSQLRESnrow (l, n) | ullint n) = "mac#%"

    mysql_num_fields

    Synopsis

    fun mysql_num_fields
      {l:agz} (
      res: !MYSQLRESptr l
    ) : [n:nat] (MYSQLRESnfield (l, n) | int n) = "mac#%"

    mysql_field_tell

    Synopsis

    fun mysql_field_tell
      {l:agz}{n:int} (
      pf: MYSQLRESnfield (l, n) | res: !MYSQLRESptr l
    ) : natLte (n) = "mac#%"

    mysql_field_seek

    Synopsis

    fun mysql_field_seek
      {l:agz}{n:int} (
      pf: MYSQLRESnfield (l, n) | res: !MYSQLRESptr l, i: natLte (n)
    ) : natLte (n) = "mac#%"

    mysql_affected_rows

    Synopsis

    fun mysql_affected_rows
      {l:agz} (mysql: !MYSQLptr l): ullint = "mac#%"

    mysql_use_result

    Synopsis

    fun mysql_use_result
      {l:agz} (mysql: !MYSQLptr (l)): MYSQLRESptr0 = "mac#%"

    mysql_store_result

    Synopsis

    fun mysql_store_result
      {l:agz} (mysql: !MYSQLptr (l)): MYSQLRESptr0 = "mac#%"

    mysql_free_result

    Synopsis

    fun mysql_free_result (result: MYSQLRESptr0): void = "mac#%"

    mysql_data_seek

    Synopsis

    fun mysql_data_seek
      {l:agz} (result: !MYSQLRESptr l, ofs: ullint): void = "mac#%"

    mysql_fetch_row

    Synopsis

    fun mysql_fetch_row
      {l:agz} (res: !MYSQLRESptr (l)): MYSQLROW0 (l) = "mac#%"

    mysql_unfetch_row

    Synopsis

    prfun mysql_unfetch_row
      {l1,l2:addr} (
      res: !MYSQLRESptr (l1), row: MYSQLROW (l1, l2)
    ) :<> void // end of [mysql_unfetch_row]

    mysql_fetch_lengths

    Synopsis

    fun mysql_fetch_lengths
      {l:agz} (res: !MYSQLRESptr (l)): MYSQLROWLEN0 (l) = "mac#%"

    mysql_unfetch_lengths

    Synopsis

    prfun mysql_unfetch_lengths
      {l1,l2:addr} (
      res: !MYSQLRESptr l1, rowlen: MYSQLROWLEN (l1, l2)
    ) :<> void // end of [mysql_unfetch_rowlen]

    mysqlrow_get_at

    Synopsis

    fun mysqlrow_get_at
      {l1,l2:addr | l2 > null}{n:int} (
      pfrow: MYSQLRESnfield (l1, n) | row: !MYSQLROW (l1, l2), i: natLt n
    ) : ptr = "mac#%" // endfun

    mysqlrowlen_get_at

    Synopsis

    fun mysqlrowlen_get_at
      {l1,l2:addr | l2 > null}{n:int} (
      pfrow: MYSQLRESnfield (l1, n) | rowlen: !MYSQLROWLEN (l1, l2), i: natLt n
    ) : ulint = "mac#%" // endfun

    mysql_fetch_field

    Synopsis

    fun mysql_fetch_field
      {l:agz} (res: !MYSQLRESptr l): MYSQLFIELDptr0 (l) = "mac#%"

    mysql_unfetch_field

    Synopsis

    prfun
    mysql_unfetch_field
      {l1,l2:addr}
      (res: !MYSQLRESptr (l1), field: MYSQLFIELDptr (l1, l2)): void

    mysql_fetch_field_direct

    Synopsis

    fun mysql_fetch_field_direct
      {l:agz}{n:int} (
      pf: MYSQLRESnfield (l, n) | res: !MYSQLRESptr l, i: natLt n
    ) : MYSQLFIELDptr1 (l) = "mac#%" // endfun

    mysql_fetch_fields

    Synopsis

    fun mysql_fetch_fields
      {l:agz}{n:int} (
      pf: MYSQLRESnfield (l, n) | res: !MYSQLRESptr l
    ) : [la:addr] (
      array_v (MYSQLROW1 (l), la, n)
    , minus (MYSQLRESptr l, array_v (MYSQLROW1 (l), la, n))
    | ptr la
    ) = "mac#%" // end of [mysql_fetch_fields]

    mysqlfield_get_name

    Synopsis

    fun mysqlfield_get_name
      {l1,l2:addr | l2 > null}
      (fld: !MYSQLFIELDptr (l1, l2)): ptr(*char*) = "mac#%"

    mysqlfield_get_length

    Synopsis

    fun mysqlfield_get_length
      {l1,l2:addr | l2 > null} (fld: !MYSQLFIELDptr (l1, l2)): ulint = "mac#%"

    mysqlfield_get_max_length

    Synopsis

    fun mysqlfield_get_max_length
      {l1,l2:addr | l2 > null} (fld: !MYSQLFIELDptr (l1, l2)): ulint = "mac#%"

    mysql_info

    Synopsis

    fun mysql_info
      {l:agz} (mysql: !MYSQLptr l): string = "mac#%"

    mysql_stat

    Synopsis

    fun mysql_stat
      {l:agz} (mysql: !MYSQLptr l): string = "mac#%"

    mysql_sqlstate

    Synopsis

    fun mysql_sqlstate (mysql: !MYSQLptr1): string = "mac#%"

    mysql_get_host_info

    Synopsis

    fun mysql_get_host_info (mysql: !MYSQLptr1): string = "mac#%"

    mysql_get_proto_info

    Synopsis

    fun mysql_get_proto_info (mysql: !MYSQLptr1): uint = "mac#%"

    mysql_get_server_info

    Synopsis

    fun mysql_get_server_info (mysql: !MYSQLptr1) : string = "mac#%"

    mysql_get_server_version

    Synopsis

    fun mysql_get_server_version (mysql: !MYSQLptr1) : ulint = "mac#%"

    mysql_get_client_info

    Synopsis

    fun mysql_get_client_info (): string = "mac#%"

    Example

    //
    staload "mysql/SATS/mysql.sats"
    //
    implement
    main () = let
      val info = mysql_get_client_info ()
    in
      printf ("MySQL client info: %s\n", @(info))
    end // end of [main]
    

    mysql_get_client_version

    Synopsis

    fun mysql_get_client_version (): ulint = "mac#%"

    Example

    //
    staload "mysql/SATS/mysql.sats"
    //
    implement
    main () = let
      val version = mysql_get_client_version ()
    in
      printf ("MySQL client version: %lu\n", @(version))
    end // end of [main]
    

    mysql_errno

    Synopsis

    fun mysql_errno (mysql: !MYSQLptr1) : uint = "mac#%"

    mysql_error

    Synopsis

    fun mysql_error (mysql: !MYSQLptr1) : string = "mac#%"

    mysql_hex_string

    Synopsis

    fun mysql_hex_string
      {lb:addr}
      {m,n:int | m >= 2*n+1} (
      pf: b0ytes(m) @ lb | pbuf: ptr lb, src: NSH(string(n)), n: size_t n
    ) : sizeLt (m) = "mac#" // end of [mysql_hex_string]

    mysql_escape_string

    Synopsis

    fun mysql_escape_string
      {lb:addr}
      {m,n:int | m >= 2*n+1} (
      pf: b0ytes(m) @ lb | pbuf: ptr lb, src: NSH(string(n)), n: size_t n
    ) : sizeLt (m) = "mac#%" // end of [mysql_escape_string]

    mysql_real_escape_string

    Synopsis

    fun mysql_real_escape_string
      {lb:addr}
      {m,n:int | m >= 2*n+1} (
      pf: b0ytes(m) @ lb
    | mysql: !MYSQLptr1, pbuf: ptr lb, src: NSH(string(n)), n: size_t n
    ) : sizeLt (m) = "mac#%" // end of [mysql_real_escape_string]

    fprint_mysqlres

    Synopsis

    fun{
    } fprint_mysqlres{l:agz}
      (out: FILEref, res: !MYSQLRESptr (l)): void

    fprint_mysqlres$sep1

    Synopsis

    fun{
    } fprint_mysqlres$sep1 (FILEref): void

    fprint_mysqlres$sep2

    Synopsis

    fun{
    } fprint_mysqlres$sep2 (FILEref): void

    fprint_mysqlres_sep

    Synopsis

    fun{
    } fprint_mysqlres_sep{l:agz}
    (
      out: FILEref
    , res: !MYSQLRESptr(l), sep1: NSH(string), sep2: NSH(string)
    ) : void // end of [fprint_mysqlres_sep]

    fprint_mysqlrow

    Synopsis

    fun{
    } fprint_mysqlrow
      {l1,l2:addr | l2 > null}{n:int}
    (
      pfrow: MYSQLRESnfield (l1, n)
    | out: FILEref, row: !MYSQLROW (l1, l2), n: int n
    ) : void // end of [fprint_mysqlrow]

    fprint_mysqlrow$sep

    Synopsis

    fun{
    } fprint_mysqlrow$sep (FILEref): void

    fprint_mysqlrow_sep

    Synopsis

    fun{
    } fprint_mysqlrow_sep
      {l1,l2:addr | l2 > null}
      {n:int} (
      pfrow: MYSQLRESnfield (l1, n)
    | out: FILEref, row: !MYSQLROW (l1, l2), n: int n, sep: NSH(string)
    ) : void // end of [fprint_mysqlrow_sep]

    Overloaded Symbols


    ptrcast

    Synopsis

    overload ptrcast with MYSQLptr2ptr
    overload ptrcast with MYSQLRESptr2ptr
    overload ptrcast with MYSQLFIELDptr2ptr
    overload ptrcast with MYSQLROW2ptr

    fprint

    Synopsis

    overload fprint with fprint_mysqlres
    overload fprint with fprint_mysqlres_sep
    overload fprint with fprint_mysqlrow
    overload fprint with fprint_mysqlrow_sep

    This page is created with ATS by Hongwei Xi and also maintained by Hongwei Xi. SourceForge.net Logo