Creates and initializes the table used to store the state for performing incremental pull
320327
function initialize () {
        return pullTaskRunner.run(function() {
            return store.defineTable({
                name: pulltimeTableName,
                columnDefinitions: {
                    id: 'string', // column for storing queryId
                    tableName: 'string', // column for storing table name 
                    value: 'date' // column for storing lastKnownUpdatedAt
                }
            });
        });
    }
1087454
def run(self):
        
        if not (self.table and self.columns):
            raise Exception("table and columns need to be specified")

        connection = self.output().connect()

        # attempt to copy the data into mysql
        # if it fails because the target table doesn't exist
        # try to create it by running self.create_table
        for attempt in range(2):
            try:
                cursor = connection.cursor()
                print("caling init copy...")
                self.init_copy(connection)
                self.copy(cursor)
                self.post_copy(connection)
                if self.enable_metadata_columns:
                    self.post_copy_metacolumns(cursor)
            except Error as err:
                if err.errno == errorcode.ER_NO_SUCH_TABLE and attempt == 0:
                    # if first attempt fails with "relation not found", try creating table
                    # logger.info("Creating table %s", self.table)
                    connection.reconnect()
                    self.create_table(connection)
                else:
                    raise
            else:
                break

        # mark as complete in same transaction
        self.output().touch(connection)
        connection.commit()
        connection.close()
56612
function Table(selector) {
    var _this = this;

    _this.$table = $(selector).eq(0);

    if (!_this.$table.length) {
      return;
    }

    _this.init();
  }
216
def _sync_table(self, columns):
        """"""
        if self._table is None:
            # Load an existing table from the database.
            self._reflect_table()
        if self._table is None:
            # Create the table with an initial set of columns.
            if not self._auto_create:
                raise DatasetException("Table does not exist: %s" % self.name)
            # Keep the lock scope small because this is run very often.
            with self.db.lock:
                self._threading_warn()
                self._table = SQLATable(self.name,
                                        self.db.metadata,
                                        schema=self.db.schema)
                if self._primary_id is not False:
                    # This can go wrong on DBMS like MySQL and SQLite where
                    # tables cannot have no columns.
                    primary_id = self._primary_id or self.PRIMARY_DEFAULT
                    primary_type = self._primary_type or Types.integer
                    increment = primary_type in [Types.integer, Types.bigint]
                    column = Column(primary_id, primary_type,
                                    primary_key=True,
                                    autoincrement=increment)
                    self._table.append_column(column)
                for column in columns:
                    if not column.name == self._primary_id:
                        self._table.append_column(column)
                self._table.create(self.db.executable, checkfirst=True)
        elif len(columns):
            with self.db.lock:
                self._reflect_table()
                self._threading_warn()
                for column in columns:
                    if not self.has_column(column.name):
                        self.db.op.add_column(self.name, column, self.db.schema)
                self._reflect_table()
546421
def _initialize(self, chain, length):
        

        if self._getfunc is None:
            self._getfunc = self.db.model._funs_to_tally[self.name]

        # Determine size
        try:
            self._shape = np.shape(self._getfunc())
        except TypeError:
            self._shape = None

        self._vstr = ', '.join(var_str(self._shape))

        # If the table already exists, exit now.
        if chain != 0:
            return

        # Create the variable name strings.
        vstr = ', '.join(v + ' FLOAT' for v in var_str(self._shape))
        query = """CREATE TABLE IF NOT EXISTS [%s]
                     (recid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
                      trace  int(5), %s)""" % (self.name, vstr)
        self.db.cur.execute(query)
778614
def create_table(table)
      puts "attempting to create table #{table}..."
      begin
        tt = @dbr.prepare("CREATE TABLE #{table}(id INTEGER PRIMARY KEY);")
        ee = tt.execute
        puts "table created correctly.".green
      rescue
        puts "error while creating table #{table}".red
        exit
      end
    end
33741
def init(context, reset, force):
    """"""
    existing_tables = context.obj['store'].engine.table_names()
    if force or reset:
        if existing_tables and not force:
            message = f"Delete existing tables? [{', '.join(existing_tables)}]"
            click.confirm(click.style(message, fg='yellow'), abort=True)
        context.obj['store'].drop_all()
    elif existing_tables:
        click.echo(click.style("Database already exists, use '--reset'", fg='red'))
        context.abort()

    context.obj['store'].setup()
    message = f"Success! New tables: {', '.join(context.obj['store'].engine.table_names())}"
    click.echo(click.style(message, fg='green'))
766960
def _initialize_table(self, column_count):
        
        header = [''] * column_count
        alignment = [self.default_alignment] * column_count
        width = [0] * column_count
        padding = [self.default_padding] * column_count

        self._column_count = column_count
        self._column_headers = HeaderData(self, header)
        self._column_alignments = AlignmentMetaData(self, alignment)
        self._column_widths = PositiveIntegerMetaData(self, width)
        self._left_padding_widths = PositiveIntegerMetaData(self, padding)
        self._right_padding_widths = PositiveIntegerMetaData(self, padding)
70286
private function initialize()
    {
        $this->tablename = sprintf('%s%s', $this->app['config']->get('general/database/prefix', 'bolt_'), 'log_change');
        $this->allowed = ['INSERT', 'UPDATE', 'DELETE'];
        $this->initialized = true;
    }
649600
void init() {

        if (m_container == null) {
            m_container = new IndexedContainer();
            setContainerDataSource(m_container);
        } else {
            m_container.removeAllContainerFilters();
            m_container.removeAllItems();
        }
        for (TableProperty prop : TableProperty.values()) {
            m_container.addContainerProperty(prop, prop.getType(), prop.getDefaultValue());
            setColumnHeader(prop, prop.getLocalizedMessage());
        }

        setItemIconPropertyId(TableProperty.Icon);
        setRowHeaderMode(RowHeaderMode.ICON_ONLY);
        setColumnWidth(null, 40);
        setSelectable(true);
        setMultiSelect(true);

        for (I_CmsResourceType type : CmsVaadinUtils.getResourceTypes()) {
            CmsExplorerTypeSettings typeSetting = OpenCms.getWorkplaceManager().getExplorerTypeSetting(
                type.getTypeName());
            Item item = m_container.addItem(type.getTypeName());
            item.getItemProperty(TableProperty.ID).setValue(String.valueOf(type.getTypeId()));
            item.getItemProperty(TableProperty.Icon).setValue(CmsResourceUtil.getBigIconResource(typeSetting, null));
            item.getItemProperty(TableProperty.Name).setValue(CmsVaadinUtils.getMessageText(typeSetting.getKey()));
            item.getItemProperty(TableProperty.ShortName).setValue(type.getTypeName());
            item.getItemProperty(TableProperty.Module).setValue(type.getModuleName());
        }

        setVisibleColumns(TableProperty.Name, TableProperty.ShortName, TableProperty.ID, TableProperty.Module);
    }
7906
@SuppressWarnings("unchecked")
    private void expandTable() {
        int newCapacity = currentCapacity + increment;
        if (newCapacity < currentCapacity) {
            throw new IllegalStateException(
                            "Attempt to expand LookupTable beyond maximum capacity");
        }
        E[] theNewArray = (E[]) new Object[newCapacity];
        System.arraycopy(this.theElementArray, 0, theNewArray, 0, currentCapacity);
        theElementArray = theNewArray;
        currentCapacity = newCapacity;
    }
638196
def create_table(unique_keys):
    
    _State.new_transaction()
    _State.table.create(bind=_State.engine, checkfirst=True)
    if unique_keys != []:
        create_index(unique_keys, unique=True)
    _State.table_pending = False
    _State.reflect_metadata()
1346154
def init_database(self):
        """"""
        with contextlib.closing(self.database.cursor()) as cursor:
            cursor.execute("""
              CREATE TABLE IF NOT EXISTS users(
                id INTEGER PRIMARY KEY AUTOINCREMENT,
                name VARCHAR(32)
              )
            """)
159852
private void initialize() {
        cfName = config.getTable();

        if (!ArrayUtils.isEmpty(config.getInputColumns())) {
            columns = StringUtils.join(config.getInputColumns(), ",");
        }

        partitioner = Utils.newTypeInstance(config.getPartitionerClassName(), IPartitioner.class);

        try {
            session = createConnection();

            retrieveKeys();
        } catch (Exception e) {
            throw new DeepIOException(e);
        }

        rowIterator = new RowIterator();
    }
376610
public void initialize() {
		if (dataClass == null) {
			throw new IllegalStateException("dataClass was never set on " + getClass().getSimpleName());
		}
		if (tableName == null) {
			tableName = extractTableName(databaseType, dataClass);
		}
	}
337607
function (db) {
        //create a table called state;
        return db
            .createTable("state", function () {
                this.primaryKey("id");
                this.name(String);
                this.population("integer");
                this.founded(Date);
                this.climate(String);
                this.description("text");
            })
            .chain(function () {
                //create another table called capital
                return db.createTable("capital", function () {
                    this.primaryKey("id");
                    this.population("integer");
                    this.name(String);
                    this.founded(Date);
                    this.foreignKey("stateId", "state", {key: "id", onDelete: "CASCADE"});
                });
            });
    }
12995
protected void createTable(){
        sqlManager.executeUpdate(
                new StringSqlResource(String.format("CREATE TABLE %s (VERSION NUMERIC NOT NULL)", tableName)));

        sqlManager.executeUpdate(
                new StringSqlResource(String.format("INSERT INTO %s (0))", tableName)));
    }