def create_db(data, dbfn, id_spec=None, force=False, verbose=False,
              checklines=10, merge_strategy='error', transform=None,
              gtf_transcript_key='transcript_id', gtf_gene_key='gene_id',
              gtf_subfeature='exon', force_gff=False,
              force_dialect_check=False, from_string=False, keep_order=False,
              text_factory=sqlite3.OptimizedUnicode, force_merge_fields=None,
              pragmas=constants.default_pragmas, sort_attribute_values=False,
              dialect=None, _keep_tempfiles=False, infer_gene_extent=True,
              disable_infer_genes=False, disable_infer_transcripts=False,
              **kwargs):
    _locals = locals()
    deprecation_handler(kwargs)
    kwargs = dict((i, _locals[i]) for i in constants._iterator_kwargs)
    iterator = iterators.DataIterator(**kwargs)
    kwargs.update(**_locals)
    if dialect is None:
        dialect = iterator.dialect
    kwargs['data'] = iterator._iter
    kwargs['directives'] = iterator.directives
    kwargs['checklines'] = 0
    if force_gff or (dialect['fmt'] == 'gff3'):
        cls = _GFFDBCreator
        id_spec = id_spec or 'ID'
        add_kwargs = dict(
            id_spec=id_spec,
        )
    elif dialect['fmt'] == 'gtf':
        cls = _GTFDBCreator
        id_spec = id_spec or {'gene': 'gene_id', 'transcript': 'transcript_id'}
        add_kwargs = dict(
            transcript_key=gtf_transcript_key,
            gene_key=gtf_gene_key,
            subfeature=gtf_subfeature,
            id_spec=id_spec,
        )
    kwargs.update(**add_kwargs)
    kwargs['dialect'] = dialect
    c = cls(**kwargs)
    c.create()
    if dbfn == ':memory:':
        db = interface.FeatureDB(c.conn,
                                 keep_order=keep_order,
                                 pragmas=pragmas,
                                 sort_attribute_values=sort_attribute_values,
                                 text_factory=text_factory)
    else:
        db = interface.FeatureDB(c,
                                 keep_order=keep_order,
                                 pragmas=pragmas,
                                 sort_attribute_values=sort_attribute_values,
                                 text_factory=text_factory)
    return db