github.com/gramework/gramework@v1.8.1-0.20231027140105-82555c9057f5/x/sqlgen/create.go (about)

     1  package sqlgen
     2  
     3  // Create starts construction
     4  // of CREATE query
     5  func Create() *CreateBuilder {
     6  	return new(CreateBuilder)
     7  }
     8  
     9  // Database says that we are CREATE-ing
    10  // a DATABASE with given name
    11  // It's an alias of (*CreateBuilder).DB
    12  func (cb *CreateBuilder) Database(name string) *CreateDatabaseBuilder {
    13  	return cb.DB(name)
    14  }
    15  
    16  // DB says that we are CREATE-ing
    17  // a DATABASE with given name
    18  func (cb *CreateBuilder) DB(name string) *CreateDatabaseBuilder {
    19  	return &CreateDatabaseBuilder{
    20  		name: name,
    21  	}
    22  }
    23  
    24  // Table says that we are CREATE-ing
    25  // a TABLE with given name
    26  func (cb *CreateBuilder) Table(name string) *CreateTableBuilder {
    27  	return &CreateTableBuilder{
    28  		name:    name,
    29  		columns: make([]tableColumn, 0),
    30  	}
    31  }