Skip to content

v1.6.0 Remove panics and add Embedded type

Compare
Choose a tag to compare
@nullism nullism released this 29 Jun 04:12
· 12 commits to main since this release

This release contains the new Embedded type. Embedded, like Embedder, produces a raw value for a query. It differs from Embedder in that it can be used as a string:

	q := bqb.New("embedded: ?, unembedded: ?", bqb.Embedded("raw"), "bound")
	q.Print()
	// Prints:
	// SQL: embedded: "one"."two"."""three""", unembedded: ?
	// PARAMS: [bound]

NOTE This release also removes panics. This was done to minimize runtime crashes. Since this utilizes the existing error return for the ToX methods it should not cause any crashes. This means that extra or missing params in queries bqb.New("? ?", 1) or bqb.New("", 1) now return an error when converting to SQL which seems like the agreed upon proper way to handle this.