class_docstr: SQLIODataset
docstr: SQLIODataset.
docstr_tok: ["SQLIODataset","."]
code: def __init__(self, query, endpoint=None, spec=None, internal=True):
      """SQLIODataset."""
      with tf.name_scope("SQLIODataset"):
          assert internal
          endpoint = endpoint or ""
          (
              resource,
              count,
              fields,
              dtypes,
          ) = core_ops.io_sql_iterable_init(query, endpoint)
          if spec is None:
              fields = tf.unstack(fields)
              dtypes = tf.unstack(dtypes)
              spec = {
                  field.numpy().decode(): tf.TensorSpec(
                      [None],
                      tf.as_dtype(dtype.numpy()),
                      field.numpy().decode(),
                  )
                  for (field, dtype) in zip(fields, dtypes)
              }
          else:
              # Make sure shape is [None] and name is part of the spec
              spec = {
                  k: tf.TensorSpec([None], v.dtype, k)
                  for k, v in spec.items()
              }
  
          flatten = tf.nest.flatten(spec)
          fields = [e.name for e in flatten]
          dtypes = [e.dtype for e in flatten]
  
          self._resource = resource
          dataset = tf.data.Dataset.range(0, count)
  
          def f(index):
              return tf.nest.pack_sequence_as(
                  spec,
                  core_ops.io_sql_iterable_read(
                      resource, index, fields, dtypes
                  ),
              )
  
          dataset = dataset.map(f)
          dataset = dataset.unbatch()
          self._dataset = dataset
          super().__init__(self._dataset._variant_tensor)
  
imports: import tensorflow
  from tensorflow_io.python.ops import core_ops
label_desc: Use image node_id 1 to create a new SQLIODataset object from inherited base classes: tf.data with example: obj = SQLIODataset(query, endpoint, spec, internal)