JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrJFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr ғgBdZddlmZddlmZmZmZmZmZm Z m Z m Z m Z m Z mZmZmZdZdZdZdZdZd ZGd d eZGd d eZGddeZGddeZGddeZy)z,Implementation of the CRUD database objects.)ProgrammingError) FindStatement AddStatementRemoveStatementModifyStatementSelectStatementInsertStatementDeleteStatementUpdateStatementCreateCollectionIndexStatementDropCollectionIndexStatementCreateViewStatementAlterViewStatementCreateTableStatementz_SELECT COUNT(*) FROM information_schema.views WHERE table_schema = '{0}' AND table_name = '{1}'z`SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = '{0}' AND table_name = '{1}'zMSELECT COUNT(*) FROM information_schema.schemata WHERE schema_name like '{0}'z SELECT COUNT(*) FROM `{0}`.`{1}`z DROP TABLE IF EXISTS `{0}`.`{1}`zDROP VIEW IF EXISTS `{0}`.`{1}`cTeZdZdZdZedZedZdZdZ dZ dZ d Z y ) DatabaseObjectzProvides base functionality for database objects. Args: schema (mysqlx.Schema): The Schema object. name (str): The database object name. cr||_||_|jjj|_yN)_schema_name get_session _connection)selfschemanames b/opt/hc_python/lib64/python3.12/site-packages/../../../lib/python3.12/site-packages/mysqlx/crud.py__init__zDatabaseObject.__init__5s+  <<335AAc|jS)z3:class:`mysqlx.Schema`: The Schema object. rrs rrzDatabaseObject.schema:s||rc|jS)z/str: The name of this database object. rr!s rrzDatabaseObject.name@szzrc|jS)z{Returns the Schema object of this database object. Returns: mysqlx.Schema: The Schema object. r r!s r get_schemazDatabaseObject.get_schemaFs ||rc|jS)zwReturns the name of this database object. Returns: str: The name of this database object. r#r!s rget_namezDatabaseObject.get_nameNs zzrct)zVerifies if this object exists in the database. Returns: bool: `True` if object exists in database. Raises: NotImplementedError: This method must be implemented. )NotImplementedErrorr!s rexists_in_databasez!DatabaseObject.exists_in_databaseVs "!rc"|jSr)r*r!s r am_i_realzDatabaseObject.am_i_realas&&((rc"|jSr)r'r!s rwho_am_izDatabaseObject.who_am_ids}}rN) __name__ __module__ __qualname____doc__rpropertyrrr%r'r*r,r.rrrr.sN B    ")rrceZdZdZfdZdZdZdZddZdZ ddZ dd Z dd Z d Z d Zd ZddZddZdZddZxZS)SchemazA client-side representation of a database schema. Provides access to the schema contents. Args: session (mysqlx.XSession): Session object. name (str): The Schema name. c<||_tt|||yr)_sessionsuperr6r)rsessionr __class__s rrzSchema.__init__ps  fd$T40rc|tj|j}|jj |dk(SzVerifies if this object exists in the database. Returns: bool: `True` if object exists in database. r)_COUNT_SCHEMAS_QUERYformatrrexecute_sql_scalarrsqls rr*zSchema.exists_in_databasets4 #))$**522371<?E@sB$B,+B,cXt||}|r|js td|S)zwReturns the table of the given name for this schema. Returns: mysqlx.Table: Table object. zTable does not exist)r[r*r)rrrVr^s rrUzSchema.get_tables0 dD! ++-&'=>> rcXt||}|r|js td|S)ztReturns the view of the given name for this schema. Returns: mysqlx.View: View object. zView does not exist)Viewr*r)rrrVviews rget_viewzSchema.get_views0 D$ **,&'<== rcXt||}|r|js td|S)zReturns the collection of the given name for this schema. Returns: mysqlx.Collection: Collection object. zCollection does not exist)rLr*r)rrrVrRs rget_collectionzSchema.get_collections1  d+ 002&'BCCrcz|jjdtj|j|dy)zmDrops a collection. Args: name (str): The name of the collection to be dropped. rBFN)rexecute_nonquery_DROP_TABLE_QUERYr?rrrs rdrop_collectionzSchema.drop_collections2 )) $++DJJ=u Frct||}|jr|j|y|jj dt j |j|dy)zcDrops a table. Args: name (str): The name of the table to be dropped. rBFN)r[is_view drop_viewrrhrir?r)rrr^s r drop_tablezSchema.drop_tablesS dD! ==? NN4    - -(// DA5 Jrcz|jjdtj|j|dy)zaDrops a view. Args: name (str): The name of the view to be dropped. rBFN)rrh_DROP_VIEW_QUERYr?rrjs rrnzSchema.drop_views2 )) #**4::t? ?rc<t||}|j|S)aACreates in the current schema a new view with the specified name and retrieves an object representing the new view created. Args: name (string): The name of the view. replace (Optional[bool]): `True` to add replace. Returns: mysqlx.View: View object. )rbget_create_statement)rrreplacercs r create_viewzSchema.create_views!D$((11rc:t||}|jS)zAlters a view in the current schema with the specified name and retrieves an object representing the view. Args: name (string): The name of the view. Returns: mysqlx.View: View object. )rbget_alter_statement)rrrcs r alter_viewzSchema.alter_viewsD$''))rc|s tdt||}|js t||S|s td|S)NzTable name is invalidzTable already exists)rr[r*r)rrrur^s r create_tablezSchema.create_table*sJ"#:; ;dD!'')'d3 3"#9: : rF)r/r0r1r2rr*rrSrWr_rUrdrfrkrornrtryr|r~ __classcell__r;s@rr6r6hs[1=&5&   F JE0 2 *rr6c^eZdZdZfdZdZd dZdZdZd dZ d dZ d Z d Z d Z xZS) rLzRepresents a collection of documents on a schema. Args: schema (mysqlx.Schema): The Schema object. name (str): The collection name. c.tt| ||yr)r9rLrrrrr;s rrzCollection.__init__<s j$(6rctj|jj|j}|j j |dk(Sr=)_COUNT_TABLES_QUERYr?rr'rrr@rAs rr*zCollection.exists_in_database?sC "(()>)>)@$**M22371<rrLcNeZdZdZfdZdZdZdZdZd dZ dZ d Z xZ S) r[zRepresents a database table on a schema. Provides access to the table through standard INSERT/SELECT/UPDATE/DELETE statements. Args: schema (mysqlx.Schema): The Schema object. name (str): The table name. c.tt| ||yr)r9r[rrs rrzTable.__init__s eT#FD1rctj|jj|j}|j j |dk(Sr=)rr?rrrrr@rAs rr*zTable.exists_in_databases@ "(():):DJJG22371<rrirqobjectrr6rLr[rbr4rrrs03$BBBBJK71 647V7tJ^JZe>e>PS=NS=l'(5'(r