-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for generating code without schema reference with supplyi…
- Loading branch information
1 parent
098a1bc
commit f21078a
Showing
30 changed files
with
605 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
typo/generated-and-checked-in/typo/generated/information_schema/CardinalNumber.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* File has been automatically generated by `typo` for internal use. | ||
* | ||
* IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN. | ||
* | ||
* (If you're developing `typo` and want to change it: run `bleep generate-sources`) | ||
*/ | ||
package typo | ||
package generated | ||
package information_schema | ||
|
||
import anorm.Column | ||
import anorm.ParameterMetaData | ||
import anorm.ToStatement | ||
import java.sql.Types | ||
import play.api.libs.json.Reads | ||
import play.api.libs.json.Writes | ||
|
||
/** Domain `information_schema.cardinal_number` | ||
* Constraint: CHECK ((VALUE >= 0)) | ||
*/ | ||
case class CardinalNumber(value: Int) | ||
object CardinalNumber { | ||
implicit lazy val arrayColumn: Column[Array[CardinalNumber]] = Column.columnToArray(column, implicitly) | ||
implicit lazy val arrayToStatement: ToStatement[Array[CardinalNumber]] = typo.generated.IntArrayToStatement.contramap(_.map(_.value)) | ||
implicit lazy val column: Column[CardinalNumber] = Column.columnToInt.map(CardinalNumber.apply) | ||
implicit lazy val ordering: Ordering[CardinalNumber] = Ordering.by(_.value) | ||
implicit lazy val parameterMetadata: ParameterMetaData[CardinalNumber] = new ParameterMetaData[CardinalNumber] { | ||
override def sqlType: String = """"information_schema"."cardinal_number"""" | ||
override def jdbcType: Int = Types.OTHER | ||
} | ||
implicit lazy val reads: Reads[CardinalNumber] = Reads.IntReads.map(CardinalNumber.apply) | ||
implicit lazy val text: Text[CardinalNumber] = new Text[CardinalNumber] { | ||
override def unsafeEncode(v: CardinalNumber, sb: StringBuilder) = Text.intInstance.unsafeEncode(v.value, sb) | ||
override def unsafeArrayEncode(v: CardinalNumber, sb: StringBuilder) = Text.intInstance.unsafeArrayEncode(v.value, sb) | ||
} | ||
implicit lazy val toStatement: ToStatement[CardinalNumber] = ToStatement.intToStatement.contramap(_.value) | ||
implicit lazy val writes: Writes[CardinalNumber] = Writes.IntWrites.contramap(_.value) | ||
} |
39 changes: 39 additions & 0 deletions
39
typo/generated-and-checked-in/typo/generated/information_schema/CharacterData.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* File has been automatically generated by `typo` for internal use. | ||
* | ||
* IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN. | ||
* | ||
* (If you're developing `typo` and want to change it: run `bleep generate-sources`) | ||
*/ | ||
package typo | ||
package generated | ||
package information_schema | ||
|
||
import anorm.Column | ||
import anorm.ParameterMetaData | ||
import anorm.ToStatement | ||
import java.sql.Types | ||
import play.api.libs.json.Reads | ||
import play.api.libs.json.Writes | ||
|
||
/** Domain `information_schema.character_data` | ||
* No constraint | ||
*/ | ||
case class CharacterData(value: String) | ||
object CharacterData { | ||
implicit lazy val arrayColumn: Column[Array[CharacterData]] = Column.columnToArray(column, implicitly) | ||
implicit lazy val arrayToStatement: ToStatement[Array[CharacterData]] = ToStatement.arrayToParameter(ParameterMetaData.StringParameterMetaData).contramap(_.map(_.value)) | ||
implicit lazy val column: Column[CharacterData] = Column.columnToString.map(CharacterData.apply) | ||
implicit lazy val ordering: Ordering[CharacterData] = Ordering.by(_.value) | ||
implicit lazy val parameterMetadata: ParameterMetaData[CharacterData] = new ParameterMetaData[CharacterData] { | ||
override def sqlType: String = """"information_schema"."character_data"""" | ||
override def jdbcType: Int = Types.OTHER | ||
} | ||
implicit lazy val reads: Reads[CharacterData] = Reads.StringReads.map(CharacterData.apply) | ||
implicit lazy val text: Text[CharacterData] = new Text[CharacterData] { | ||
override def unsafeEncode(v: CharacterData, sb: StringBuilder) = Text.stringInstance.unsafeEncode(v.value, sb) | ||
override def unsafeArrayEncode(v: CharacterData, sb: StringBuilder) = Text.stringInstance.unsafeArrayEncode(v.value, sb) | ||
} | ||
implicit lazy val toStatement: ToStatement[CharacterData] = ToStatement.stringToStatement.contramap(_.value) | ||
implicit lazy val writes: Writes[CharacterData] = Writes.StringWrites.contramap(_.value) | ||
} |
Oops, something went wrong.