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

     1  package sqlgen
     2  
     3  import (
     4  	"fmt"
     5  )
     6  
     7  // VarChar sets VarChar(given size) type
     8  // to the column
     9  func (cb *ColumnBuilder) VarChar(size int64) *CreateTableBuilder {
    10  	return cb.tableBuilder.appendColumn(&tableColumn{
    11  		name:    cb.name,
    12  		sqlType: fmt.Sprintf("VARCHAR(%v)", size),
    13  	})
    14  }
    15  
    16  // Integer sets INTEGER type to the column
    17  func (cb *ColumnBuilder) Integer() *CreateTableBuilder {
    18  	return cb.tableBuilder.appendColumn(&tableColumn{
    19  		name:    cb.name,
    20  		sqlType: "INTEGER",
    21  	})
    22  }