profile
viewpoint
Erik Hollensbe erikh the internet I help make @tinyci and @box-builder.

box-builder/box 231

A Next-Generation Builder for Docker Images

erikh/chef-dashboard 20

A simple Heads-up-display for Chef Node information.

erikh/archive 11

Simple library to manage archives with libarchive and FFI

erikh/chef-chef-dashboard 8

chef-dashboard install cookbook

cmaujean/dashing-github-stats 6

A Dashing dashboard widget for some stats about a repository on github.

erikh/chef-ssh_known_hosts2 6

provider for editing ssh's known_hosts files (as opposed to templating)

erikh/chef-dynamic_dns 5

Do-it-yourself Dynamic DNS with Chef

box-builder/overmount 3

OverlayFS layer mounter used for creating OCI/Docker images - not ready for use

erikh/askerb 3

Question-based Templating

issue commentfacebookincubator/ent

Feature: Provide a flag to disable example test generation

Can I please set something to not generate the examples I don't need at all for the operation of this system. If it's environment variables; great! That works too.

I just really don't see the value in making a feature of entc being "here's some files to delete". That is a very unattractive feature of a code generator.

On Mon, Jan 20, 2020 at 2:39 PM Alex Snast notifications@github.com wrote:

Don't see a good enough reason to overload entcwith extra flags. Just run ent generate && rm <test_file> instead.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/facebookincubator/ent/issues/297?email_source=notifications&email_token=AAAET2532SS6BX7AJLHXDDLQ6YRYVA5CNFSM4KI7OVWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJN7CQI#issuecomment-576450881, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAET27FGQ6CKZPOTDEXAHDQ6YRYVANCNFSM4KI7OVWA .

erikh

comment created time in 3 days

issue commentfacebookincubator/ent

Feature: Provide a flag to disable example test generation

It's because i'm using testify and passing -testify.m to the package list in entirety. it's not a user error the tests just don't process that flag right. Every time I generate the schema I need to remove these tests.

erikh

comment created time in 4 days

issue openedfacebookincubator/ent

Feature: Provide a flag to disable example test generation

These tests are incompatible with the flags I pass to go test ./.... A git clean -fx with a proper .gitignore KOs them but I'd really prefer a flag to entc generate.

Really enjoying using ent for a few microservices I've been hacking on, thanks for making it!

created time in 4 days

pull request commentfacebookincubator/ent

WIP: SQLite3 support for migrations

Let me know how you want it split up and I will do the work.

erikh

comment created time in 4 days

pull request commentfacebookincubator/ent

WIP: SQLite3 support for migrations

Between a variety of personal conflicts I can't really spend too much more time on this, and I feel bad just leaving it here. Happy to split it up over the next week if you want to take pieces of it, or you can cherry-pick what you would like to keep. I really do need this behavior though, so I'd encourage you to persist with the features this patch was intended to deliver.

Sorry man. I hate doing this to people but life is just getting too busy.

erikh

comment created time in 4 days

push eventerikh/ent

Ariel Mashraki

commit sha ab732c7654a9dabf786a920ab0a9c24cf8d836ca

dialect/sql: add drop-fk command to builder

view details

Ariel Mashraki

commit sha 7fc36890273690edf2c29efdc35ac4e2a1a776ed

dialect/sql/schema: add prepare option to mysql dialect

view details

Ariel Mashraki

commit sha 59f172f06a60af7f486da2f2cd1af218c166e954

entc/integration/migrate: add integration tests for migrate

view details

Ariel Mashraki

commit sha 0dfc9954a3913f0c740a08410cb5210e3fcf3d55

Merge pull request #265 from facebookincubator/sqlschema/dropfk sqlschema/dropfk

view details

Christoph Hartmann

commit sha 46982d2f0515e2bf8340232195ec1c75c4d3438d

dialect/sql: add predicates for composite where query (#264) * add predicates for composite where query Signed-off-by: Christoph Hartmann <chris@lollyrock.com> * use existing table.Columns method * simplify the composite operator methods

view details

Jian Li

commit sha fc6a9b1a9bc99b4989e932005a561918821b09ea

fix meta.tmpl code generating incomplete issue. (#268)

view details

Ariel Mashraki

commit sha 13ae2fcea1b4ef09af09cd83ef734f7d7ce44440

entc/integration: add tests for mixim fields (#270)

view details

Ariel Mashraki

commit sha b54007ef5686f1bcfaff0e8280b718252f49e079

Entc/enums (#271) * ent: add default value setter to enum builder Co-authored-by: Dario Ielardi <dario.ielardi@gmail.com>

view details

Ariel Mashraki

commit sha 9cb0eb74679c3682ee0528dc8c607fabe5ebdf1d

entc/gen: reject fields without name (#273) Fixes #272

view details

Ariel Mashraki

commit sha b93958ebf41655714d3dc7d3937327bd0ad01036

dialect/sql/sqlgraph: add query edges function (#274)

view details

danforth

commit sha faf5be3b2870f289af7c52b8b23dd71eb25ba2be

entc/gen: fix Go keywords conflicts when using enums (#276) Co-authored-by: heavycharged <41610989+heavycharged@users.noreply.github.com>

view details

Ariel Mashraki

commit sha cd366c07e2c13e7a7b422a88a59d203cdbd594a2

dialect/sqlscan: add tests for nulltype scanning (#278)

view details

Ariel Mashraki

commit sha caf721df4769c0babfa8e79b6fee720cce8f9410

entc/gen: add eager-loading support (#263) * entc/gen: add OwnFK indicator for type edges * entc/gen: add Edges field for generated types * entc/gen: add With<T> method to query-builder template * entc/gen: scan and assign foreign-keys on eager-loading * entc/gen: load fk-relations (wip) * entc/integration: add o2m/m2o tests for eager-loading * entc/gen: add m2m support for eager-loading * entc/gen: add integration tests for m2m and subgraphs * entc/gen/integration: add tests for o2o eager-loading * all: generate all assets

view details

Ariel Mashraki

commit sha 82bc6408707b9fba3de52962e0654144976860e8

doc: add documentation and examples for eager-loading (#282)

view details

Ariel Mashraki

commit sha f270e41f6e45131c72a0c6d3991180a1091d7eb4

doc: add comment on future development of eager-loading (#283)

view details

Ariel Mashraki

commit sha e016ca918c2c7fa9dc2c62e696754355310ca74b

doc: add ent-users link to readme (#288)

view details

Ariel Mashraki

commit sha 71221877ee14bcea72bb4e77b3b8eaefbc9a6daf

ci: run tests twice for testing migration (#290)

view details

Ariel Mashraki

commit sha 91c163525feadf9c74ad887322b1e132e3107b8c

dialect/sql/schema: correctly read uint32 type in migration (#289) Fixes #287

view details

Ariel Mashraki

commit sha 94866e213e4a42afc1a103186a255ee3fdf19fca

ci: pin mysql8 to mysql 8.0.18 (not latest) (#293) Following my bug report in MySQL issue tracker, I've pinned MySQL8 version to be 8.0.18 until we figure out if it's a bug or a new change that we need to support. Link: https://bugs.mysql.com/bug.php\?id\=98250

view details

Ariel Mashraki

commit sha 9b2b53f559f4da5ac872f59628ab29d1b31d0c17

entc/gen: avoid conflict local vars with user packages (#292) Fixes #284

view details

push time in 4 days

startedcrev-dev/cargo-crev

started time in 5 days

issue commentfacebookincubator/ent

migrations with sqlite3

Hey; sorry the patch is so late. I've just been really busy. I'd encourage you to watch #221 for new developments, however, it's a long thread.

erikh

comment created time in 14 days

Pull request review commentfacebookincubator/ent

WIP: SQLite3 support for migrations

 func (t *TableAlter) DropColumn(c *ColumnBuilder) *TableAlter {  // AddForeignKey adds a foreign key constraint to the `ALTER TABLE` statement. func (t *TableAlter) AddForeignKey(fk *ForeignKeyBuilder) *TableAlter {-	t.Queries = append(t.Queries, &Wrapper{"ADD CONSTRAINT %s", fk})+	if t.Dialect() == dialect.SQLite {+		t.Queries = append(t.Queries, &Wrapper{"ADD COLUMN %s", fk})+	} else {+		t.Queries = append(t.Queries, &Wrapper{"ADD CONSTRAINT %s", fk})+	}

@a8m ok after some noodling on this (and re-reading what you said, multiple times, sorry about missing the message there!):

  • addFK leads to import cycles best I can see without creating a third package, but I'm still playing around with this approach and it might prove fruitful. I can't share the migrate package with the builder directly because of the relationship that already exists. I'm guessing I'm missing something here and will report back after more searching around.

  • setting things to true works fine, but then the alter cannot work at all unless I am still misunderstanding? I'm not sure is the best approach to adding edges to existing tables. I've implemented most of this and the clear problem with it is that it will never work on the second migration to the same table as the user probably would expect (with fks populated).

I think what might make sense here (but need to examine a little more) is altering the addColumn interface method to accept a foreignkey struct, or otherwise relate the foreign keys to the columns being currently built (which is true for FKs but not the columns that they are related to). This way I can deliberately say "I want to ensure my foreign key relationships are always added as a part of my column mutations to tables, no other way". And I think, but am not 100% certain, this way the work in fk.DSL() can either be simplified or removed for SQLite's case and we can just match/query the foreign keys directly in the Column portion of the migration in the tBuilder method and simplify the building process here.

WDYT?

Also sincerely sorry for the uber-high latency on this patch, I'll try to button things up this week.

erikh

comment created time in 19 days

push eventerikh/dnsserver

Erik Hollensbe

commit sha e82778662366024a8cef944f50dfa160e3f91c59

Interface backend Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

Erik Hollensbe

commit sha e8b89924c95dc56c3d85288afde897a04cfaa2cb

Merge branch 'interface-backend'

view details

push time in 20 days

release erikh/dnsserver

v0.1.0

released time in 20 days

created tagerikh/dnsserver

tagv0.1.0

A small DNS service for communicating A and SRV records.

created time in 20 days

push eventerikh/sdd

Erik Hollensbe

commit sha 99737a50904dcf778a745fe48f031732dd276c89

Rewrite domains to incorporate both service and name This was makings really confusing elsewhere. We should also set the client expectations accordingly instead of making the user make the dotted notation. Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

Erik Hollensbe

commit sha fe525edf572c0a573c6cf12de9af1fc483864947

Merge branch 'domain-rewrite'

view details

push time in 21 days

push eventerikh/i3bar

Erik Hollensbe

commit sha 82cea9a2930ef0951bbee9ab9dd6f07cbb2d9d47

more personal crap Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

push time in 22 days

pull request commentfacebookincubator/ent

WIP: SQLite3 support for migrations

I haven't forgotten about this; just haven't had much time this week. Thanks and sorry.

erikh

comment created time in 22 days

push eventerikh/ent

Erik Hollensbe

commit sha d50f09290f0da50151427713d7fd87c3185ae09c

Apply suggestions from code review Co-Authored-By: Ariel Mashraki <7413593+a8m@users.noreply.github.com>

view details

push time in 24 days

push eventerikh/ent

Alex Snast

commit sha f14653be71c54acce532a682294b3889205fff0a

entc/gen: fix node out of bounds check Signed-off-by: Alex Snast <alexsn@fb.com>

view details

Alex Snast

commit sha 762af0817669a6ac01a9ab252ba35f30c5747646

Merge pull request #255 from facebookincubator/alexsn/node_bounds entc/gen: fix node out of bounds check

view details

Ariel Mashraki

commit sha 7fde9b76429bdad6bf683261d3f5ffbcd1262284

entc/gen: move sql-update-one to sqlgraph

view details

Ariel Mashraki

commit sha d6d7ef565f2aa999320d9be53bbb3653c57e6a7c

dialect/sql/sqlgraph: minor grammar changes

view details

Ariel Mashraki

commit sha 700b3bd04f7cb85baee9617ee17ee2d4315046dc

Merge pull request #257 from facebookincubator/sqlgraph/update entc/gen: move sql-update to sqlgraph

view details

Ariel Mashraki

commit sha 1c54439d40ad65f3be15b3ad65227665ea285e06

entc/gen: move scan-assign to node def

view details

Ariel Mashraki

commit sha a26b9626a63f75307b33e208ccd70c15c963dc23

entc/gen: move query-count to sqlgraph

view details

Ariel Mashraki

commit sha 6f9dade32c5f94117698963283218985ad6cadfc

entc/gen: move query-all to sqlgraph

view details

Ariel Mashraki

commit sha c09028f58b8b44ba61b513bf26e7a42d5f085ea3

dialect/sql/sqlgraph: consistent scan names

view details

Ariel Mashraki

commit sha 91cdd2a087c7ee08007860a3434ec0b26a1dcf9a

entc/gen: remove unnecessary subquery on fields selection

view details

Ariel Mashraki

commit sha e3284f8e1299ec561f894e4d8055403ae113403c

Merge pull request #258 from facebookincubator/sqlgraph/query entc/gen: move scan-assign to node def

view details

Ariel Mashraki

commit sha 7a85c04c321e141eb0249a6a743c9647730b5946

entc/gen: add edge-fields + minor changes

view details

Ariel Mashraki

commit sha 4021d35e5ad38ab8c4ea68929b7063306a553aeb

entc/integration: split generate commands to packages

view details

Ariel Mashraki

commit sha 99510a458ddaa6c36040f6c188ed79b6d6390cfd

Merge pull request #259 from facebookincubator/sqlgraph/query entc/gen: add edge-fields + minor changes

view details

Ariel Mashraki

commit sha e5c5aec9b559e590f554875d664c8df4ee9d1dde

entc/gen: remove FromRows decoding

view details

Ariel Mashraki

commit sha d586492147f72d6d1a592afe0335292447883f14

Merge pull request #260 from facebookincubator/sqlgraph/query entc/gen: remove FromRows decoding

view details

Ariel Mashraki

commit sha 1f2cb87cee066c7bb2e572491c582718bba3775d

examples: regenerate assets Closes #261

view details

Ariel Mashraki

commit sha b6cfa43af6ea8215a306b85a5235f2fefbeee5df

Merge pull request #262 from facebookincubator/examples examples: regenerate assets

view details

Erik Hollensbe

commit sha da2f446f843824111c03a6bbc9dea306b764476c

SQLite3 support for migrations Work in progress until this message is removed Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

push time in 24 days

pull request commentfacebookincubator/ent

WIP: SQLite3 support for migrations

Thanks for the review. I'll try to turn this around over the weekend. I assume I probably won't hear from you until after the new year. ;) Enjoy your time.

erikh

comment created time in a month

Pull request review commentfacebookincubator/ent

WIP: SQLite3 support for migrations

 func (*SQLite) cType(c *Column) (t string) { 	return t } +func (d *SQLite) typeField(c *Column, str string) error {+	switch parts := typeFields(str); parts[0] {+	case "int", "integer":+		c.Type = field.TypeInt32+	case "smallint":+		c.Type = field.TypeInt16+	case "bigint":+		c.Type = field.TypeInt64+	case "tinyint":+		c.Type = field.TypeInt8+	case "double", "real":+		c.Type = field.TypeFloat64+	case "timestamp", "datetime":

timestamp is used in postgres at least -- it's SQL 92 IIRC. There is also timestamp with time zone. the NOW() function typically returns a timestamp of some fashion in SQL.

I need to do a second pass and make sure all the types line up, I think I took this from the mysql driver. Sorry if reviewing this caused you a headache.

erikh

comment created time in a month

Pull request review commentfacebookincubator/ent

WIP: SQLite3 support for migrations

 type changes struct { // changeSet returns a changes object to be applied on existing table. // It fails if one of the changes is invalid. func (m *Migrate) changeSet(curr, new *Table) (*changes, error) {+	if curr == nil {+		return nil, errors.New("current state could not be determined during change set generation")+	}++	if new == nil {+		return nil, errors.New("determined state could not be determined during change set generation")+	}

ok. Would you like wrappers for these package name identifiers usable for github.com/pkg/errors.Wrap? Could do this in a later PR.

erikh

comment created time in a month

Pull request review commentfacebookincubator/ent

WIP: SQLite3 support for migrations

 func (t *TableAlter) DropColumn(c *ColumnBuilder) *TableAlter {  // AddForeignKey adds a foreign key constraint to the `ALTER TABLE` statement. func (t *TableAlter) AddForeignKey(fk *ForeignKeyBuilder) *TableAlter {-	t.Queries = append(t.Queries, &Wrapper{"ADD CONSTRAINT %s", fk})+	if t.Dialect() == dialect.SQLite {+		t.Queries = append(t.Queries, &Wrapper{"ADD COLUMN %s", fk})+	} else {+		t.Queries = append(t.Queries, &Wrapper{"ADD CONSTRAINT %s", fk})+	}

ok, that makes sense. I think I get the general gist of what your'e suggesting:

func (s *SQLite) addFK(t *Table, *fk ForeignKey) string {
   // construct string to add foreign key
}

func (s *SQLite) fkExist(t *Table, *fk ForeignKey) bool {
   return true
}
erikh

comment created time in a month

pull request commentfacebookincubator/ent

WIP: SQLite3 support for migrations

ok. it's a holiday here in the US so I'll be addressing this later this week; thanks for the review!

On Tue, Dec 24, 2019 at 5:57 AM Ariel Mashraki notifications@github.com wrote:

@a8m commented on this pull request.

Great work @erikh https://github.com/erikh! I've added a few comments.

Most of them are minor, but the major one should be handled (or we can discuss about it).

In dialect/sql/builder.go https://github.com/facebookincubator/ent/pull/221#discussion_r361163803:

  • if t.Dialect() == dialect.SQLite {
  • t.Queries = append(t.Queries, &Wrapper{"ADD COLUMN %s", fk})
    
  • } else {

  • t.Queries = append(t.Queries, &Wrapper{"ADD CONSTRAINT %s", fk})
    
  • }

IMO this logic should reside in the schema migration package.

I'm thinking about 2 options (but you're welcome to suggest other alternatives):

  1. Add an addFK method to the sqlDialect interface that generates a different command for the sqlite3 dialect.
  2. Change fkExist logic in sqlite3 to always returns true (as it was before), and append the foreign-key-clause https://sqlite.org/syntax/foreign-key-clause.html to the new column we create. For example:

ALTER table t1 ADD COLUMN c1 int REFERENCES t2(c2) ON DELETE SET NULL;

Let me know what do you think about it.

In dialect/sql/builder.go https://github.com/facebookincubator/ent/pull/221#discussion_r361163868:

  • if fk.Dialect() == dialect.SQLite {
  • fk.Pad().Ident(fk.columns[0])
    
  • } else {

  • fk.WriteString("FOREIGN KEY")
    
  • fk.Nested(func(b *Builder) {
    
  • 	b.IdentComma(fk.columns...)
    
  • })
    
  • }

ditto

In dialect/sql/schema/migrate.go https://github.com/facebookincubator/ent/pull/221#discussion_r361166353:

@@ -235,6 +236,14 @@ type changes struct {

// changeSet returns a changes object to be applied on existing table.

// It fails if one of the changes is invalid.

func (m *Migrate) changeSet(curr, new *Table) (*changes, error) {

  • if curr == nil {

  • return nil, errors.New("current state could not be determined during change set generation")
    
  • }

  • if new == nil {

  • return nil, errors.New("determined state could not be determined during change set generation")
    
  • }

Use this format: sql/schema: determined state could ....

Also, maybe add the table name as well?

In dialect/sql/schema/mysql.go https://github.com/facebookincubator/ent/pull/221#discussion_r361166529:

@@ -240,9 +240,8 @@ func (d *MySQL) scanColumn(c *Column, rows *sql.Rows) error {

if nullable.Valid {

  c.Nullable = nullable.String == "YES"

}

  • switch parts := strings.FieldsFunc(c.typ, func(r rune) bool {

  • return r == '(' || r == ')' || r == ' ' || r == ','
    
  • }); parts[0] {

  • switch parts := typeFields(c.typ); parts[0] {

nice!

In dialect/sql/schema/sqlite.go https://github.com/facebookincubator/ent/pull/221#discussion_r361167218:

  • c.Size = math.MaxInt32
    
  • c.Type = field.TypeString
    
  • case "varchar":

  • c.Type = field.TypeString
    
  • if len(parts) > 1 {
    
  • 	size, err := strconv.ParseInt(parts[1], 10, 64)
    
  • 	if err != nil {
    
  • 		return fmt.Errorf("converting varchar size to int: %v", err)
    
  • 	}
    
  • 	c.Size = size
    
  • }
    
  • case "json":

  • c.Type = field.TypeJSON
    
  • case "uuid":

  • c.Type = field.TypeUUID
    
  • case "enum":

I don't think this clause is needed.

In dialect/sql/schema/sqlite.go https://github.com/facebookincubator/ent/pull/221#discussion_r361168187:

@@ -119,6 +123,52 @@ func (*SQLite) cType(c *Column) (t string) {

return t

}

+func (d *SQLite) typeField(c *Column, str string) error {

  • switch parts := typeFields(str); parts[0] {

  • case "int", "integer":

  • c.Type = field.TypeInt32
    
  • case "smallint":

  • c.Type = field.TypeInt16
    
  • case "bigint":

  • c.Type = field.TypeInt64
    
  • case "tinyint":

  • c.Type = field.TypeInt8
    
  • case "double", "real":

  • c.Type = field.TypeFloat64
    
  • case "timestamp", "datetime":

"timestamp"

What is usually used by other ORMs? I know that date and datetime types exist in sqlite, but not familiar with timestamp.

In dialect/sql/schema/sqlite_test.go https://github.com/facebookincubator/ent/pull/221#discussion_r361168587:

  • 		mock.ExpectQuery(escape("SELECT COUNT(*) FROM `sqlite_master` WHERE `type` = ? AND `name` = ?")).
    
  • 			WithArgs("table", "users").
    
  • 			WillReturnRows(sqlmock.NewRows([]string{"count"}).AddRow(1))
    
  • 		mock.ExpectQuery(escape(`pragma table_info('users')`)).
    
  • 			WillReturnRows(sqlmock.NewRows([]string{"id", "name", "type", "not_null", "dflt", "pk"}).
    
  • 				AddRow(0, "id", "bigint", 1, nil, 1).
    
  • 				AddRow(1, "name", "varchar", 0, nil, 0))
    
  • 		mock.ExpectQuery(escape("pragma index_list('users')")).
    
  • 			WillReturnRows(sqlmock.NewRows([]string{"seq", "name", "unique", "origin", "partial"}).
    
  • 				AddRow(0, "sqlite_autoindex_users_1", 1, "pk", 0))
    
  • 		mock.ExpectExec(escape("ALTER TABLE `users` ADD COLUMN `spouse_id` integer NULL")).
    
  • 			WillReturnResult(sqlmock.NewResult(0, 1))
    
  • 		mock.ExpectQuery(escape("pragma foreign_key_list('users')")).
    
  • 			WillReturnRows(sqlmock.NewRows([]string{"id", "seq", "table", "from", "to", "on_update", "on_delete", "match"}))
    
  • 		mock.ExpectExec("ALTER TABLE `users` ADD COLUMN `spouse_id` REFERENCES `users`\\(`id`\\) ON DELETE CASCADE").
    
  • 			WillReturnResult(sqlmock.NewResult(0, 1))
    

Great testing work!

In dialect/sql/schema/mysql.go https://github.com/facebookincubator/ent/pull/221#discussion_r361168728:

@@ -240,9 +240,8 @@ func (d *MySQL) scanColumn(c *Column, rows *sql.Rows) error {

if nullable.Valid {

  c.Nullable = nullable.String == "YES"

}

  • switch parts := strings.FieldsFunc(c.typ, func(r rune) bool {

  • return r == '(' || r == ')' || r == ' ' || r == ','
    
  • }); parts[0] {

⬇️ Suggested change


In dialect/sql/schema/migrate.go https://github.com/facebookincubator/ent/pull/221#discussion_r361168766:

@@ -235,6 +236,14 @@ type changes struct {

// changeSet returns a changes object to be applied on existing table.

// It fails if one of the changes is invalid.

func (m *Migrate) changeSet(curr, new *Table) (*changes, error) {

  • if curr == nil {

  • return nil, errors.New("current state could not be determined during change set generation")
    
  • }

⬇️ Suggested change


In dialect/sql/schema/sqlite.go https://github.com/facebookincubator/ent/pull/221#discussion_r361169217:

  • var (
    
  • 	id        int
    
  • 	seq       int
    
  • 	tableName string
    
  • 	from      string
    
  • 	to        string
    
  • 	onUpdate  string
    
  • 	onDelete  string
    
  • 	match     string
    
  • )
    
  • if err := rows.Scan(&id, &seq, &tableName, &from, &to, &onUpdate, &onDelete, &match); err != nil {
    
  • 	return false, errors.Wrap(err, "while querying foreign keys")
    
  • }
    
  • if tableName == fk.RefTable.Name && fk.Columns[0].Name == from && fk.RefColumns[0].Name == to {
    
  • 	return true, rows.Close()
    

Why not: ⬇️ Suggested change

  • 	return true, rows.Close()
    
  • 	return true, nil
    

You already call defer rows.Close() above.

In dialect/sql/schema/sqlite.go https://github.com/facebookincubator/ent/pull/221#discussion_r361169241:

  • 	from      string
    
  • 	to        string
    
  • 	onUpdate  string
    
  • 	onDelete  string
    
  • 	match     string
    
  • )
    
  • if err := rows.Scan(&id, &seq, &tableName, &from, &to, &onUpdate, &onDelete, &match); err != nil {
    
  • 	return false, errors.Wrap(err, "while querying foreign keys")
    
  • }
    
  • if tableName == fk.RefTable.Name && fk.Columns[0].Name == from && fk.RefColumns[0].Name == to {
    
  • 	return true, rows.Close()
    
  • }
    
  • }

  • return false, rows.Close()

ditto

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebookincubator/ent/pull/221?email_source=notifications&email_token=AAAET22LWKJSRBX4GTGM3R3Q2IINRA5CNFSM4JWDFFK2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCQFATQA#pullrequestreview-336202176, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAET22AI2G6ELEUYZ3WLLLQ2IINRANCNFSM4JWDFFKQ .

erikh

comment created time in a month

pull request commentfacebookincubator/ent

WIP: SQLite3 support for migrations

@a8m what should I do with this patch?

erikh

comment created time in a month

push eventerikh/i3bar

Erik Hollensbe

commit sha 203dc8cb4dd14078a957c5eee94f9ed6a1823975

greatly simplified blatant stupidity. Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

push time in a month

push eventerikh/i3bar

Erik Hollensbe

commit sha 3ca576fea5b69531e7610717387efc0b0f728244

ugh Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

push time in a month

push eventerikh/i3bar

Erik Hollensbe

commit sha 2d744df6ff02bec18c18d2f45bec06ad527c741a

Support taskwarrior Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

push time in a month

push eventtinyci/tinyci

Erik Hollensbe

commit sha 9b5a19769ec09c3cbefe4ce0948903922b80e617

CHANGELOG edits for 0.2.2 Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

push time in a month

release tinyci/tinyci

v0.2.2

released time in a month

push eventtinyci/tinyci

Erik Hollensbe

commit sha 3e698b740ce511b4d37d31ffd814a6d07386b150

tinyCI v0.2.2 Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

push time in a month

created tagtinyci/tinyci

tagv0.2.2

tinyCI: your tests can be run faster!

created time in a month

push eventtinyci/tinyci

Erik Hollensbe

commit sha 28e59bd5d0160bd9ea992073dcccea08ffea0d88

tinyCI v0.2.2 Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

push time in a month

created tagtinyci/ci-agents

tagv0.2.2

tinyCI microservice and tools collection

created time in a month

push eventtinyci/ci-agents

Erik Hollensbe

commit sha a4570316f51a199d1a94347368abf221cc193632

Bump VERSION This version bump is due to a bad dependency in ci-ui, no changes have been made here. Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

Erik Hollensbe

commit sha d04e2cfefc7eb978ed9b1e7b9625e2ec2fe0d307

Upgrade golang dependencies Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

Erik Hollensbe

commit sha 656785080c578b8805e9c738f06166b83510ce1c

Merge pull request #174 from erikh/bump-version

view details

push time in a month

PR merged tinyci/ci-agents

Upgrade golang dependencies

Signed-off-by: Erik Hollensbe github@hollensbe.org

+61977 -43792

0 comment

318 changed files

erikh

pr closed time in a month

PR opened tinyci/ci-agents

Upgrade golang dependencies

Signed-off-by: Erik Hollensbe github@hollensbe.org

+61977 -43792

0 comment

318 changed files

pr created time in a month

create barncherikh/ci-agents

branch : bump-version

created branch time in a month

created tagtinyci/ci-ui

tagv0.2.1

tinyCI react UI

created time in a month

push eventtinyci/ci-ui

Erik Hollensbe

commit sha 0d669052dde5cc2066b3bf24395b7242a17bb499

Upgrade serialize-javascript Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

Erik Hollensbe

commit sha 832f1eea999480e6d77d7f05024a107bb007f38d

Merge pull request #88 from erikh/upgrade-deps2

view details

push time in a month

PR merged tinyci/ci-ui

Upgrade serialize-javascript

Signed-off-by: Erik Hollensbe github@hollensbe.org

+6 -0

0 comment

2 changed files

erikh

pr closed time in a month

PR opened tinyci/ci-ui

Upgrade serialize-javascript

Signed-off-by: Erik Hollensbe github@hollensbe.org

+6 -0

0 comment

2 changed files

pr created time in a month

create barncherikh/ci-ui

branch : upgrade-deps2

created branch time in a month

push eventerikh/ent

Erik Hollensbe

commit sha b4f476b3442f7711bb62491b5989fcfc242ff94b

SQLite3 support for migrations Work in progress until this message is removed Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

push time in a month

push eventerikh/ent

Erik Hollensbe

commit sha e75a14cca90fc2d506cc46cd3015ec4f8330ddd3

SQLite3 support for migrations Work in progress until this message is removed Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

push time in a month

pull request commentfacebookincubator/ent

WIP: SQLite3 support for migrations

one last thing; I just don't know if this is going to behave in the following scenario:

  • you define a schema with two tables, each with a Node and no edges
  • migrate
  • define an edge between the two existing nodes

This is probably not a problem for very simple situations but could be in the future.

erikh

comment created time in a month

pull request commentfacebookincubator/ent

WIP: SQLite3 support for migrations

some notes:

  • we now pass *Table and *ForeignKey objects directly to the fkExist interface method; it's simpler this way. let me know if you object.
  • since there is no symbol in sqlite for FK columns, we simply match the parameters. I may be missing a few that are necessary for ent, please advise.
erikh

comment created time in a month

pull request commentfacebookincubator/ent

WIP: SQLite3 support for migrations

This should pass all tests now; I've squashed the patch and I think it's ready for at least an initial review. I'm sure there are still some things outstanding.

erikh

comment created time in a month

push eventerikh/ent

Ariel Mashraki

commit sha 0fb33aaa5e632f2fadb9687bb8caf1054c25b10a

dialect/sql/sqlgraph: add update node api Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/222 Reviewed By: alexsn Differential Revision: D18833733 fbshipit-source-id: e833d84f4e5e5c73b1c85e7387472c9a87b7947e

view details

Ariel Mashraki

commit sha f65cf5150eb33791e9ccfe5419beeb78c1100043

dialect/sqlscan: add interface{} scanning support Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/223 Reviewed By: alexsn Differential Revision: D18878581 fbshipit-source-id: 4a60ceea6c092f065e52e6b3bb625487451a815d

view details

Ariel Mashraki

commit sha 754a8c9daa30cf87ff1a4913e96bede47556e9b3

examples: regenerate assets

view details

Ariel Mashraki

commit sha ef7a1ed300f29147c425477ce5b562ec2beab72a

examples: make examples testable

view details

Ariel Mashraki

commit sha 75c70bac1b1563a68cb94c6103d13bafd6cf9bea

Merge pull request #225 from facebookincubator/examples/regen examples: regenerate assets

view details

Ariel Mashraki

commit sha 8f3f496308bf9939f432d270018d209d370692a1

doc: fix example link in edges doc

view details

Ariel Mashraki

commit sha d2b65749e340476de62972394859208bb83d339f

Merge pull request #226 from facebookincubator/doc/edge-examples doc: fix example link in edges doc

view details

Ariel Mashraki

commit sha f86e39f179b8a4770d61e195699d026eaafd6dc4

dialect/sql/sqlgraph: update nodes using predicate Currently, only fields and own-FK. Next PR will edge types: M2M, O2M and O2O (non-inverse).

view details

Ariel Mashraki

commit sha 330061fbf1932ab6282f2b0c3a7708ff9ea26789

Merge pull request #228 from facebookincubator/sqlgraph/update dialect/sql/sqlgraph: update nodes using predicate

view details

Ariel Mashraki

commit sha 876e454d1e7d0750f20f888d8f1847aa6b6dc325

dialect/sql/sqlgraph: add rest of edges to update-nodes

view details

Jian Li

commit sha e84da15b37887f700c70f1b7e6e405ff73775eef

fix predicates doc type error (#229)

view details

Ariel Mashraki

commit sha 429e331b3220078f3eafbe293f31f8555bf78df8

dialect/sql/sqlgraph: add edge tests for nodes update

view details

Ariel Mashraki

commit sha ddd69ec90a8fd0bf7bce003824e5c01716112dfb

Merge pull request #230 from facebookincubator/sqlgraph/update sqlgraph/update

view details

Ariel Mashraki

commit sha 9f324ce0301ac65e85d8823102bd3680d0aba6dc

dialect/sql/sqlgraph: delete nodes in the graph

view details

Ariel Mashraki

commit sha a23008a9830c3cc954c32d13c61ea0bdf5b4bf3b

Merge pull request #231 from facebookincubator/sqlgraph/delete dialect/sql/sqlgraph: delete nodes in the graph

view details

Ariel Mashraki

commit sha 4ab244cf934a30c8272b388921ba5cdb12385cb1

dialect/sql/sqlgraph: first work on nodes querying

view details

Ariel Mashraki

commit sha 486c540eccb36d257a96927e37b68184beb88a9e

Merge pull request #232 from facebookincubator/sqlgraph/query dialect/sql/sqlgraph: first work on nodes querying

view details

Ariel Mashraki

commit sha 26ccecdf6db208e9a489b358ff5bd1b46d44ee3d

dialect/sql/sqlgraph: add initial work for nodes-count

view details

Ariel Mashraki

commit sha fb4e1b6234fd170720f9fb8a8e76a7a1acb35582

dialect/sql/sqlgraph: add tests for nodes count

view details

Ariel Mashraki

commit sha 6f3d7d899918d2c25c8af52f5db036163cde527b

Merge pull request #234 from facebookincubator/sqlgraph/query dialect/sql/sqlgraph: add initial work for nodes-count

view details

push time in a month

push eventerikh/ent

Erik Hollensbe

commit sha 519175d63c84233446d01e5298238d9b20d87d88

Updated tests from postgresql sources; refactors as necessary Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

push time in a month

Pull request review commentmitchellh/go-mruby

Support mruby 2.1.0

 func TestMrbStackedException(t *testing.T) { 	}  	mrb.Close()++	// TODO(take-cheeze): Test below+	return

I need this functionality for my own projects that depend on go-mruby. What changed between 1.2 and 2.1 that caused this to break?

take-cheeze

comment created time in a month

Pull request review commentmitchellh/go-mruby

Support mruby 2.1.0

 func TestIsDead(t *testing.T) {  	mrb.Close() +	/*

I think the major point of this test is to run that block that's commented out; is there any way to re-enable the test? This feels like a change in API.

take-cheeze

comment created time in a month

Pull request review commentmitchellh/go-mruby

Support mruby 2.1.0

 func TestIsDead(t *testing.T) {  	mrb.Close() +	/*

why is this test commented out?

take-cheeze

comment created time in a month

Pull request review commentmitchellh/go-mruby

Support mruby 2.1.0

 func TestMrbStackedException(t *testing.T) { 	}  	mrb.Close()++	// TODO(take-cheeze): Test below+	return

let's make sure we pass all tests before merge.

take-cheeze

comment created time in a month

Pull request review commentmitchellh/go-mruby

Support mruby 2.1.0

 type CompileContext struct { 	ctx           *C.mrbc_context 	filename      string 	mrb           *Mrb-	captureErrors bool+	// captureErrors bool

please remove this line if it's not being used

take-cheeze

comment created time in a month

Pull request review commentmitchellh/go-mruby

Support mruby 2.1.0

 lint: 	sh golint.sh  megacheck:

can we rename this task to 'staticcheck'? also, nice catch, thanks!

take-cheeze

comment created time in a month

pull request commentmitchellh/go-mruby

Support mruby 2.1.0

oh, to clarify, I think dropping 1.10, and 1.11 support is probably worth it if it causes you to write unnecessary workarounds or other complexity.

@mitchellh I think I'm making a safe judgment call, but please shout out if you disagree.

take-cheeze

comment created time in a month

pull request commentmitchellh/go-mruby

Support mruby 2.1.0

Hey! Awesome!

If you don't mind at least making sure it tests on 1.13 I would greatly appreciate it. It's in the .travis.yml file at the root of the repo.

I can work on 1.12 and getting go modules working after this patch is ready.

Thanks for contributing!

take-cheeze

comment created time in a month

startedMarinX/keylogger

started time in a month

startedeiannone/keyboard

started time in a month

push eventerikh/jsonbuffer

Erik Hollensbe

commit sha 8fbde8714c670259e5642260dd25d0d4ff956901

Ditch the lock since I overengineered it Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

push time in a month

push eventerikh/jsonbuffer

Erik Hollensbe

commit sha f8556d5386066fc8073e169a497dcd5ecc436aba

Add a notice to the read call Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

push time in a month

PublicEvent

push eventerikh/jsonbuffer

Erik Hollensbe

commit sha fc9582902dfa5b075f5fe1c0af9e990b01935c76

jsonbuffer is a package to implement buffer envelopes as JSON. Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

push time in a month

push eventerikh/jsonbuffer

Erik Hollensbe

commit sha 47177c9844f2d1b9c55fa62512ca81d8f0eeda34

jsonbuffer is a package to implement buffer envelopes as JSON. Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

push time in a month

push eventerikh/jsonbuffer

Erik Hollensbe

commit sha bb4540a71d21eb5fdeeac089b6cfed828127c00c

jsonbuffer is a package to implement buffer envelopes as JSON. Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

push time in a month

pull request commentfacebookincubator/ent

WIP: SQLite3 support for migrations

Sorry, I haven't had time to get to this over the week. I'll try to polish this off next week.

erikh

comment created time in a month

issue commentrancher/k3s

Insecure Registry Support

Please note that does not cover actually launching the registry with a service definition that supports that. That's more of a general topic.

On Fri, Dec 13, 2019 at 11:15 PM Erik Hollensbe h-e@hollensbe.org wrote:

VladoPortos:

edit to taste and put in /etc/rancher/k3s/registries.yaml:

mirrors: "10.0.0.220:5000": endpoint: - "http://10.0.0.220:5000"

then sudo service k3s restart

On Fri, Dec 13, 2019 at 10:41 PM VladoPortos notifications@github.com wrote:

So is there a documentation about how to put private insecure registry inside pod, and have it working with cluster ? I'm googling for a week now, and finding little to no answer ( without using external domain )

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rancher/k3s/issues/145?email_source=notifications&email_token=AAAET26DENT4UNWD4SNEY63QYR5X5A5CNFSM4G3T7TL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG33YOY#issuecomment-565689403, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAET2Y2XTS6J2Y4NOKQQV3QYR5X5ANCNFSM4G3T7TLQ .

nnordrum

comment created time in a month

issue commentrancher/k3s

Insecure Registry Support

VladoPortos:

edit to taste and put in /etc/rancher/k3s/registries.yaml:

mirrors: "10.0.0.220:5000": endpoint: - "http://10.0.0.220:5000"

then sudo service k3s restart

On Fri, Dec 13, 2019 at 10:41 PM VladoPortos notifications@github.com wrote:

So is there a documentation about how to put private insecure registry inside pod, and have it working with cluster ? I'm googling for a week now, and finding little to no answer ( without using external domain )

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rancher/k3s/issues/145?email_source=notifications&email_token=AAAET26DENT4UNWD4SNEY63QYR5X5A5CNFSM4G3T7TL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG33YOY#issuecomment-565689403, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAET2Y2XTS6J2Y4NOKQQV3QYR5X5ANCNFSM4G3T7TLQ .

nnordrum

comment created time in a month

push eventerikh/sdd

Erik Hollensbe

commit sha 18dc57e1fbcd9dd0cc495283919b9e3b12d42f7e

No tests for this one but hopefully soon Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

Erik Hollensbe

commit sha 2fa9820e9c8d607bd2bc879274309106db31b656

Merge branch 'fix-dial'

view details

push time in a month

startedfrapposelli/wwhrd

started time in a month

pull request commentfacebookincubator/ent

WIP: SQLite3 support for migrations

Ok yeah, if you don't think we'll need it I'll review and make sure none of our tests require it... I think that's where I got blocked last time I checked in on it.

I'll review later tonight and get back to you, on another project atm.

On Wed, Dec 11, 2019 at 12:32 PM Ariel Mashraki notifications@github.com wrote:

for example adding a foreign key to an existing column -- you have to perform this operation.

Currently, a FK is added with its column to the schema file, when a new edge is added to the ent.Schema. Meaning, we don't have situations that a FK is added to a column that already exists in the table.

We can add support for this (I don't really mind), but I think it adds much more complexity for a feature/functionality that we don't really need.

Let me know what do you think.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebookincubator/ent/pull/221?email_source=notifications&email_token=AAAET25SYPRP7IFGV4MEBZLQYFE6PA5CNFSM4JWDFFK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGUPGAA#issuecomment-564720384, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAET2665CIDVNSYJUGSBMTQYFE6PANCNFSM4JWDFFKQ .

erikh

comment created time in a month

pull request commentfacebookincubator/ent

WIP: SQLite3 support for migrations

it's when FKs need to be migrated or altered that it'll be an issue. if you are not adding the column -- for example adding a foreign key to an existing column -- you have to perform this operation.

On Wed, Dec 11, 2019 at 11:49 AM Ariel Mashraki notifications@github.com wrote:

https://www.sqlite.org/lang_altertable.html#otheralter is going to be necessary for the FK moves and other operations on constraints such as changing the on delete or update triggers.

Maybe I miss something, but why do we need to create a temporary table if we can create FKs as mentioned in #200 (comment) https://github.com/facebookincubator/ent/issues/200#issuecomment-560369316 ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebookincubator/ent/pull/221?email_source=notifications&email_token=AAAET22ETCCGTHO5GNCTPTDQYE74PA5CNFSM4JWDFFK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGULG4A#issuecomment-564704112, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAET23WBZNIPJIKBX4745LQYE74PANCNFSM4JWDFFKQ .

erikh

comment created time in a month

pull request commentfacebookincubator/ent

WIP: SQLite3 support for migrations

https://www.sqlite.org/lang_altertable.html#otheralter is going to be necessary for the FK moves and other operations on constraints such as changing the on delete or update triggers.

Where would this code best live?

erikh

comment created time in a month

pull request commentfacebookincubator/ent

WIP: SQLite3 support for migrations

nvm found it

erikh

comment created time in a month

pull request commentfacebookincubator/ent

WIP: SQLite3 support for migrations

how do I safely run the integrations? is there a doc for it?

erikh

comment created time in a month

pull request commentfacebookincubator/ent

WIP: SQLite3 support for migrations

ok the migration tests are up as well as some related fixes. I'll fix up any tests next, but what should I be doing with this patch after this? writing more tests?

erikh

comment created time in a month

push eventerikh/ent

Erik Hollensbe

commit sha 0698ada8ab39b12238bac4590d3a348e8038dcd6

Updated tests from postgresql sources; refactors as necessary Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

push time in a month

pull request commentfacebookincubator/ent

WIP: SQLite3 support for migrations

I'm in process of porting the postgres table migration tests over to sqlite3 but your other change suggestions have been implemented.

erikh

comment created time in a month

push eventerikh/ent

Erik Hollensbe

commit sha 3fc424708ae072f18fa90e03faa660455b3fd535

Drop the tinyint(1) support for bools in sqlite3 Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

Erik Hollensbe

commit sha 10d56c16ee2d9b356f41acbb9ee2ad0060dc27bf

Refactor fkExist interface method; fix sqlite3 implementation Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

push time in a month

issue commentrancher/k3s

Insecure Registry Support

Please document this, it took me half a day of googling and starting in on my own ticket to find this issue.

nnordrum

comment created time in 2 months

pull request commentfacebookincubator/ent

WIP: SQLite3 support for migrations

I'll probably put more in on this today. This might be up for a while as I continue to chip on it; hope that's ok. Thanks for the feedback!

On Sun, Dec 8, 2019 at 9:06 AM Ariel Mashraki notifications@github.com wrote:

@a8m https://github.com/a8m at the risk of spamming you, here are some highlights in the existing work you should take note of. I have the FK work to do still and a few tests, but otherwise I think everything is functioning.

You're not spamming at all. Thanks for working on this. If you prefer to work with smaller PRs (like, only table scanning and them reading indexes, etc..) that's fine too.

Note that due to how sqlite3 lib handles parameters, I don't think using a ? or binding syntax will work in the pragmas. I think since we're working totally on trusted input that a sprintf is safe, but I would like to hear your input.

I think Sprintf is fine here.

https://github.com/facebookincubator/ent/pull/221/files#diff-39e4b302014280cdc713d8c1a32acb2eR140 -- this tinyint(1) special case for mysql is perpetuated here, do we want that?

I don't think so. I think it's OK to support only bool and boolean, because these are the common types in the ORMs outside (feel free to correct me if I have a wrong assumption).

https://github.com/facebookincubator/ent/pull/221/files#diff-56a4aef6402a64fbe636f02a23d8fa57R22 better place for this test?

entc/integration/migrate/migrate_test.go

you can see there is no globally unique identifier. what matches against the name provided to fkExist?

Let's change the method then to:

fkExist(ctx context.Context, tx dialect.Tx, table, fk string) (bool, error)


Let me know if you plan to break it to smaller PRs, or I'll just review it. Thanks again for your contribution.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebookincubator/ent/pull/221?email_source=notifications&email_token=AAAET26YULB6FTCI62E7A5TQXUSSRA5CNFSM4JWDFFK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGHD34I#issuecomment-562970097, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAET2ZHITGXFTQNCYOZHLLQXUSSRANCNFSM4JWDFFKQ .

erikh

comment created time in 2 months

delete branch erikh/sdd

delete branch : http-heartbeat

delete time in 2 months

push eventerikh/sdd

Erik Hollensbe

commit sha 8b9c8fde8a2a8e02675f4d6584669d4c1648fd4e

Heartbeating for HTTP This adds client and server heartbeat support. Just select `heartbeat.HTTP` when registering the service instead of just supplying true. Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

Erik Hollensbe

commit sha a76db40ae3c002cf5824afe51e27a14b867265c7

Merge pull request #1 from erikh/http-heartbeat Heartbeating for HTTP

view details

push time in 2 months

PR merged erikh/sdd

Heartbeating for HTTP

This adds client and server heartbeat support. Just select heartbeat.HTTP when registering the service instead of just supplying true.

Signed-off-by: Erik Hollensbe github@hollensbe.org

+279 -45

0 comment

10 changed files

erikh

pr closed time in 2 months

PR opened erikh/sdd

Heartbeating for HTTP

This adds client and server heartbeat support. Just select heartbeat.HTTP when registering the service instead of just supplying true.

Signed-off-by: Erik Hollensbe github@hollensbe.org

+279 -45

0 comment

10 changed files

pr created time in 2 months

create barncherikh/sdd

branch : http-heartbeat

created branch time in 2 months

pull request commentfacebookincubator/ent

WIP: SQLite3 support for migrations

No rush; I'll keep chipping away at it.

On Fri, Dec 6, 2019 at 9:50 AM Ariel Mashraki notifications@github.com wrote:

Hey @erikh https://github.com/erikh, thanks for working on this! I'll review this on Sunday (weekend in Israel is Friday–Saturday).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebookincubator/ent/pull/221?email_source=notifications&email_token=AAAET22ACBLC5UQQQYDTU73QXKGGNA5CNFSM4JWDFFK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGE3HMY#issuecomment-562672563, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAET223LVDTNSMXT3THRC3QXKGGNANCNFSM4JWDFFKQ .

erikh

comment created time in 2 months

push eventerikh/ent

Erik Hollensbe

commit sha 8ac4326d2cd8b8b86feed4afa33d6de3529f08fd

SQLite3 support for migrations Work in progress until this message is removed Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

push time in 2 months

push eventerikh/ent

Erik Hollensbe

commit sha 7403e9110358491bb99545db587e054282d1d8c2

SQLite3 support for migrations Work in progress until this message is removed Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

push time in 2 months

pull request commentfacebookincubator/ent

WIP: SQLite3 support for migrations

Additionally, it doesn't seem like constraints are uniquely named throughout sqlite3, leading to an issue i've pushed here:

you can see there is no globally unique identifier. what matches against the name provided to fkExist?

sqlite> create table foo (bar int primary key);
sqlite> create table quux (baz int references foo (bar));
sqlite> .schema
CREATE TABLE foo (bar int primary key);
CREATE TABLE quux (baz int references foo (bar));
sqlite> pragma foreign_key_list('quux');
0|0|foo|baz|bar|NO ACTION|NO ACTION|NONE
sqlite> .headers on
sqlite> pragma foreign_key_list('quux');
id|seq|table|from|to|on_update|on_delete|match
0|0|foo|baz|bar|NO ACTION|NO ACTION|NONE

I'm committing some code now that shows my problem; read the fkexist method.

Thanks again for your patience with me. :)

erikh

comment created time in 2 months

pull request commentfacebookincubator/ent

WIP: SQLite3 support for migrations

@a8m at the risk of spamming you, here are some highlights in the existing work you should take note of. I have the FK work to do still and a few tests, but otherwise I think everything is functioning.

Note that due to how sqlite3 lib handles parameters, I don't think using a ? or binding syntax will work in the pragmas. I think since we're working totally on trusted input that a sprintf is safe, but I would like to hear your input.

https://github.com/facebookincubator/ent/pull/221/files#diff-39e4b302014280cdc713d8c1a32acb2eR140 -- this tinyint(1) special case for mysql is perpetuated here, do we want that?

https://github.com/facebookincubator/ent/pull/221/files#diff-56a4aef6402a64fbe636f02a23d8fa57R22 better place for this test?

also the following refactors were made:

https://github.com/facebookincubator/ent/pull/221/files#diff-932a340b0ff6f22c5b5a59ce1e8a4972R434 - first function is taken from mysql driver and the second is taken from pg, these are just utility functions to perform standard operations I needed. I hope the moves are ok.

erikh

comment created time in 2 months

push eventerikh/ent

Erik Hollensbe

commit sha fe7eecd2a7f0a52dc9092f28d07bb1bba351333a

SQLite3 support for migrations Work in progress until this message is removed Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

push time in 2 months

push eventerikh/ent

Erik Hollensbe

commit sha 5eb1f2148180d6b8ad721a0af5aba5b508816240

SQLite3 support for migrations Work in progress until this message is removed Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

push time in 2 months

push eventerikh/ent

Erik Hollensbe

commit sha 7f842d0b8a6e2366c1a53b706f51e1d784803d6c

SQLite3 support for migrations Work in progress until this message is removed Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

push time in 2 months

push eventerikh/ent

Erik Hollensbe

commit sha 2417728030b1c2db8c2c5e101159805f432add06

SQLite3 support for migrations Work in progress until this message is removed Signed-off-by: Erik Hollensbe <github@hollensbe.org>

view details

push time in 2 months

issue commentfacebookincubator/ent

migrations with sqlite3

I started #221 (linking these two) to discuss changes to the outstanding patch.

erikh

comment created time in 2 months

PR opened facebookincubator/ent

WIP: SQLite3 support for migrations

This is a basic start, a lot of cut and paste but it does pass some very basic tests now. I still have more work to do but I was hoping we could discuss some of it as it arrives, so here's the PR.

+219 -4

0 comment

5 changed files

pr created time in 2 months

create barncherikh/ent

branch : sqlite3-migration-support

created branch time in 2 months

issue commentfacebookincubator/ent

migrations with sqlite3

Yeah I was working with the equivalent postgres code already. I just didn't see this bit about the pragma use. This helps a ton; should have something in a day or two.

erikh

comment created time in 2 months

issue commentfacebookincubator/ent

migrations with sqlite3

it looks like the SQL builder is going to need to support sqlite3 pragma statements before I move further. do you have a preferred way to do this? it seems very "select"-centric at the moment at a glance.

erikh

comment created time in 2 months

PR closed facebookincubator/ent

Resolve panic where nothing would be migrated with SQLite3 driver

This was caused by the current state being represented as nil; this was resolved by returning an empty change set when the current value is nil.

Hoping to turn this into a series of commits where I contribute small additions towards the sqlite3 work. LMK if I'm heading in the right direction; specifically, I don't know where the best place for tests are.

+34 -0

3 comments

2 changed files

erikh

pr closed time in 2 months

more