Repository: ovn-org/libovsdb
Pull request #153 (2021-06-10 12:19:50)

Rename struct tag to ovsdb
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>

coveralls: ## Pull Request Test Coverage Report for [Build 925079494](https://coveralls.io/builds/40474481)

* **5** of **5**   **(100.0%)**  changed or added relevant lines in **3** files are covered.
* No unchanged relevant lines lost coverage.
* Overall coverage remained the same at **72.373%**

---



|  Totals | [![Coverage Status](https://coveralls.io/builds/40474481/badge)](https://coveralls.io/builds/40474481) |
| :-- | --: |
| Change from base [Build 922134269](https://coveralls.io/builds/40442051): |  0.0% |
| Covered Lines: | 2727 |
| Relevant Lines: | 3768 |

---
##### 💛  - [Coveralls](https://coveralls.io)


Patch:
diff --git a/README.md b/README.md
index 94e3988..1472d2e 100644
--- a/README.md
+++ b/README.md
@@ -16,10 +16,10 @@ It's used mainly for managing the configuration of Open vSwitch and OVN, but it
 The API to interact with OVSDB is based on tagged golang structs. We call it a Model. e.g:
 
     type MyLogicalSwitch struct {
-        UUID   string            `ovs:"_uuid"` // _uuid tag is mandatory
-        Name   string            `ovs:"name"`
-        Ports  []string          `ovs:"ports"`
-        Config map[string]string `ovs:"other_config"`
+        UUID   string            `ovsdb:"_uuid"` // _uuid tag is mandatory
+        Name   string            `ovsdb:"name"`
+        Ports  []string          `ovsdb:"ports"`
+        Config map[string]string `ovsdb:"other_config"`
     }
 
 A Open vSwitch Database is modeled using a DBModel which is a created by assigning table names to pointers to these structs:
diff --git a/client/doc.go b/client/doc.go
index 8e2e14e..5abd146 100644
--- a/client/doc.go
+++ b/client/doc.go
@@ -5,10 +5,10 @@ This package uses structs, that contain the 'ovs' field tag to determine which f
 which column in the database. We refer to pointers to this structs as Models. Example:
 
    type MyLogicalSwitch struct {
-   	UUID   string            `ovs:"_uuid"` // _uuid tag is mandatory
-   	Name   string            `ovs:"name"`
-   	Ports  []string          `ovs:"ports"`
-   	Config map[string]string `ovs:"other_config"`
+   	UUID   string            `ovsdb:"_uuid"` // _uuid tag is mandatory
+   	Name   string            `ovsdb:"name"`
+   	Ports  []string          `ovsdb:"ports"`
+   	Config map[string]string `ovsdb:"other_config"`
    }
 
 Based on these Models a Database Model (see DBModel type) is built to represent
diff --git a/cmd/stress/stress.go b/cmd/stress/stress.go
index 4adcbf2..88459c6 100644
--- a/cmd/stress/stress.go
+++ b/cmd/stress/stress.go
@@ -21,18 +21,18 @@ import (
 
 // ORMBridge is the simplified ORM model of the Bridge table
 type bridgeType struct {
-	UUID        string            `ovs:"_uuid"`
-	Name        string            `ovs:"name"`
-	OtherConfig map[string]string `ovs:"other_config"`
-	ExternalIds map[string]string `ovs:"external_ids"`
-	Ports       []string          `ovs:"ports"`
-	Status      map[string]string `ovs:"status"`
+	UUID        string            `ovsdb:"_uuid"`
+	Name        string            `ovsdb:"name"`
+	OtherConfig map[string]string `ovsdb:"other_config"`
+	ExternalIds map[string]string `ovsdb:"external_ids"`
+	Ports       []string          `ovsdb:"ports"`
+	Status      map[string]string `ovsdb:"status"`
 }
 
 // ORMovs is the simplified ORM model of the Bridge table
 type ovsType struct {
-	UUID    string   `ovs:"_uuid"`
-	Bridges []string `ovs:"bridges"`
+	UUID    string   `ovsdb:"_uuid"`
+	Bridges []string `ovsdb:"bridges"`
 }
 
 var (
diff --git a/mapper/info.go b/mapper/info.go
index 2e034e8..a6fe57b 100644
--- a/mapper/info.go
+++ b/mapper/info.go
@@ -57,7 +57,7 @@ func (mi *MapperInfo) ColumnByPtr(fieldPtr interface{}) (string, error) {
 	objType := reflect.TypeOf(mi.obj).Elem()
 	for i := 0; i < objType.NumField(); i++ {
 		if objType.Field(i).Offset == offset {
-			column := objType.Field(i).Tag.Get("ovs")
+			column := objType.Field(i).Tag.Get("ovsdb")
 			if _, ok := mi.fields[column]; !ok {
 				return "", fmt.Errorf("field does not have orm column information")
 			}
@@ -115,7 +115,7 @@ func NewMapperInfo(table *ovsdb.TableSchema, obj interface{}) (*MapperInfo, erro
 	fields := make(map[string]string, objType.NumField())
 	for i := 0; i < objType.NumField(); i++ {
 		field := objType.Field(i)
-		colName := field.Tag.Get("ovs")
+		colName := field.Tag.Get("ovsdb")
 		if colName == "" {
 			// Untagged fields are ignored
 			continue
diff --git a/mapper/mapper.go b/mapper/mapper.go
index a68d37e..b49fe55 100644
--- a/mapper/mapper.go
+++ b/mapper/mapper.go
@@ -10,13 +10,13 @@ import (
 // Mapper offers functions to interact with libovsdb through user-provided native structs.
 // The way to specify what field of the struct goes
 // to what column in the database id through field a field tag.
-// The tag used is "ovs" and has the following structure
-// 'ovs:"${COLUMN_NAME}"'
+// The tag used is "ovsdb" and has the following structure
+// 'ovsdb:"${COLUMN_NAME}"'
 //	where COLUMN_NAME is the name of the column and must match the schema
 //
 //Example:
 //  type MyObj struct {
-//  	Name string `ovs:"name"`
+//  	Name string `ovsdb:"name"`
 //  }
 type Mapper struct {
 	Schema *ovsdb.DatabaseSchema
@@ -163,7 +163,7 @@ func (m Mapper) NewRow(tableName string, data interface{}, fields ...interface{}
 
 // NewEqualityCondition returns a list of equality conditions that match a given object
 // A list of valid columns that shall be used as a index can be provided.
-// If none are provided, we will try to use object's field that matches the '_uuid' ovs tag
+// If none are provided, we will try to use object's field that matches the '_uuid' ovsdb tag
 // If it does not exist or is null (""), then we will traverse all of the table indexes and
 // use the first index (list of simultaneously unique columnns) for which the provided mapper
 // object has valid data. The order in which they are traversed matches the order defined
diff --git a/model/model.go b/model/model.go
index 5f75eaf..693ac25 100644
--- a/model/model.go
+++ b/model/model.go
@@ -17,10 +17,10 @@ import (
 // The Model interface must be implemented by the pointer to such type
 // Example:
 //type MyLogicalRouter struct {
-//	UUID          string            `ovs:"_uuid"`
-//	Name          string            `ovs:"name"`
-//	ExternalIDs   map[string]string `ovs:"external_ids"`
-//	LoadBalancers []string          `ovs:"load_balancer"`
+//	UUID          string            `ovsdb:"_uuid"`
+//	Name          string            `ovsdb:"name"`
+//	ExternalIDs   map[string]string `ovsdb:"external_ids"`
+//	LoadBalancers []string          `ovsdb:"load_balancer"`
 //}
 type Model interface{}
 
@@ -100,7 +100,7 @@ func NewDBModel(name string, models map[string]Model) (*DBModel, error) {
 		}
 		hasUUID := false
 		for i := 0; i < modelType.Elem().NumField(); i++ {
-			if field := modelType.Elem().Field(i); field.Tag.Get("ovs") == "_uuid" &&
+			if field := modelType.Elem().Field(i); field.Tag.Get("ovsdb") == "_uuid" &&
 				field.Type.Kind() == reflect.String {
 				hasUUID = true
 			}
@@ -120,7 +120,7 @@ func NewDBModel(name string, models map[string]Model) (*DBModel, error) {
 func modelSetUUID(model Model, uuid string) error {
 	modelVal := reflect.ValueOf(model).Elem()
 	for i := 0; i < modelVal.NumField(); i++ {
-		if field := modelVal.Type().Field(i); field.Tag.Get("ovs") == "_uuid" &&
+		if field := modelVal.Type().Field(i); field.Tag.Get("ovsdb") == "_uuid" &&
 			field.Type.Kind() == reflect.String {
 			modelVal.Field(i).Set(reflect.ValueOf(uuid))
 			return nil
diff --git a/modelgen/table.go b/modelgen/table.go
index e245910..d0183c5 100644
--- a/modelgen/table.go
+++ b/modelgen/table.go
@@ -234,7 +234,7 @@ func AtomicType(atype string) string {
 
 // Tag returns the Tag string of a column
 func Tag(column string) string {
-	return fmt.Sprintf("ovs:\"%s\"", column)
+	return fmt.Sprintf("ovsdb:\"%s\"", column)
 }
 
 // Filename returns the filename of a table


Test patch:
diff --git a/cache/cache_test.go b/cache/cache_test.go
index 5ae41fe..138c2ca 100644
--- a/cache/cache_test.go
+++ b/cache/cache_test.go
@@ -13,9 +13,9 @@ import (
 )
 
 type testModel struct {
-	UUID string `ovs:"_uuid"`
-	Foo  string `ovs:"foo"`
-	Bar  string `ovs:"bar"`
+	UUID string `ovsdb:"_uuid"`
+	Foo  string `ovsdb:"foo"`
+	Bar  string `ovsdb:"bar"`
 }
 
 func TestRowCache_Row(t *testing.T) {
diff --git a/client/api_test.go b/client/api_test.go
index 067f765..d74b252 100644
--- a/client/api_test.go
+++ b/client/api_test.go
@@ -372,7 +372,7 @@ func TestConditionFromModel(t *testing.T) {
 		{
 			name: "wrong condition must fail",
 			model: &struct {
-				a string `ovs:"_uuid"`
+				a string `ovsdb:"_uuid"`
 			}{},
 			conds: []model.Condition{{Field: "foo"}},
 			err:   true,
diff --git a/client/api_test_model.go b/client/api_test_model.go
index 1fa825e..42b1566 100644
--- a/client/api_test_model.go
+++ b/client/api_test_model.go
@@ -111,16 +111,16 @@ var apiTestSchema = []byte(`{
     }`)
 
 type testLogicalSwitch struct {
-	UUID             string            `ovs:"_uuid"`
-	Ports            []string          `ovs:"ports"`
-	ExternalIds      map[string]string `ovs:"external_ids"`
-	Name             string            `ovs:"name"`
-	QosRules         []string          `ovs:"qos_rules"`
-	LoadBalancer     []string          `ovs:"load_balancer"`
-	DnsRecords       []string          `ovs:"dns_records"`
-	OtherConfig      map[string]string `ovs:"other_config"`
-	ForwardingGroups []string          `ovs:"forwarding_groups"`
-	Acls             []string          `ovs:"acls"`
+	UUID             string            `ovsdb:"_uuid"`
+	Ports            []string          `ovsdb:"ports"`
+	ExternalIds      map[string]string `ovsdb:"external_ids"`
+	Name             string            `ovsdb:"name"`
+	QosRules         []string          `ovsdb:"qos_rules"`
+	LoadBalancer     []string          `ovsdb:"load_balancer"`
+	DnsRecords       []string          `ovsdb:"dns_records"`
+	OtherConfig      map[string]string `ovsdb:"other_config"`
+	ForwardingGroups []string          `ovsdb:"forwarding_groups"`
+	Acls             []string          `ovsdb:"acls"`
 }
 
 // Table returns the table name. It's part of the Model interface
@@ -130,22 +130,22 @@ func (*testLogicalSwitch) Table() string {
 
 //LogicalSwitchPort struct defines an object in Logical_Switch_Port table
 type testLogicalSwitchPort struct {
-	UUID             string            `ovs:"_uuid"`
-	Up               []bool            `ovs:"up"`
-	Dhcpv4Options    []string          `ovs:"dhcpv4_options"`
-	Name             string            `ovs:"name"`
-	DynamicAddresses []string          `ovs:"dynamic_addresses"`
-	HaChassisGroup   []string          `ovs:"ha_chassis_group"`
-	Options          map[string]string `ovs:"options"`
-	Enabled          []bool            `ovs:"enabled"`
-	Addresses        []string          `ovs:"addresses"`
-	Dhcpv6Options    []string          `ovs:"dhcpv6_options"`
-	TagRequest       []int             `ovs:"tag_request"`
-	Tag              []int             `ovs:"tag"`
-	PortSecurity     []string          `ovs:"port_security"`
-	ExternalIds      map[string]string `ovs:"external_ids"`
-	Type             string            `ovs:"type"`
-	ParentName       []string          `ovs:"parent_name"`
+	UUID             string            `ovsdb:"_uuid"`
+	Up               []bool            `ovsdb:"up"`
+	Dhcpv4Options    []string          `ovsdb:"dhcpv4_options"`
+	Name             string            `ovsdb:"name"`
+	DynamicAddresses []string          `ovsdb:"dynamic_addresses"`
+	HaChassisGroup   []string          `ovsdb:"ha_chassis_group"`
+	Options          map[string]string `ovsdb:"options"`
+	Enabled          []bool            `ovsdb:"enabled"`
+	Addresses        []string          `ovsdb:"addresses"`
+	Dhcpv6Options    []string          `ovsdb:"dhcpv6_options"`
+	TagRequest       []int             `ovsdb:"tag_request"`
+	Tag              []int             `ovsdb:"tag"`
+	PortSecurity     []string          `ovsdb:"port_security"`
+	ExternalIds      map[string]string `ovsdb:"external_ids"`
+	Type             string            `ovsdb:"type"`
+	ParentName       []string          `ovsdb:"parent_name"`
 }
 
 // Table returns the table name. It's part of the Model interface
diff --git a/client/ovs_integration_test.go b/client/ovs_integration_test.go
index f2241d5..e81c076 100644
--- a/client/ovs_integration_test.go
+++ b/client/ovs_integration_test.go
@@ -20,18 +20,18 @@ const (
 
 // ORMBridge is the simplified ORM model of the Bridge table
 type bridgeType struct {
-	UUID        string            `ovs:"_uuid"`
-	Name        string            `ovs:"name"`
-	OtherConfig map[string]string `ovs:"other_config"`
-	ExternalIds map[string]string `ovs:"external_ids"`
-	Ports       []string          `ovs:"ports"`
-	Status      map[string]string `ovs:"status"`
+	UUID        string            `ovsdb:"_uuid"`
+	Name        string            `ovsdb:"name"`
+	OtherConfig map[string]string `ovsdb:"other_config"`
+	ExternalIds map[string]string `ovsdb:"external_ids"`
+	Ports       []string          `ovsdb:"ports"`
+	Status      map[string]string `ovsdb:"status"`
 }
 
 // ORMovs is the simplified ORM model of the Bridge table
 type ovsType struct {
-	UUID    string   `ovs:"_uuid"`
-	Bridges []string `ovs:"bridges"`
+	UUID    string   `ovsdb:"_uuid"`
+	Bridges []string `ovsdb:"bridges"`
 }
 
 var defDB, _ = model.NewDBModel("Open_vSwitch", map[string]model.Model{
diff --git a/mapper/info_test.go b/mapper/info_test.go
index 29f9111..370855a 100644
--- a/mapper/info_test.go
+++ b/mapper/info_test.go
@@ -74,10 +74,10 @@ func TestNewMapperInfo(t *testing.T) {
 
 func TestMapperInfoSet(t *testing.T) {
 	type obj struct {
-		Ostring string            `ovs:"aString"`
-		Oint    int               `ovs:"aInteger"`
-		Oset    []string          `ovs:"aSet"`
-		Omap    map[string]string `ovs:"aMap"`
+		Ostring string            `ovsdb:"aString"`
+		Oint    int               `ovsdb:"aInteger"`
+		Oset    []string          `ovsdb:"aSet"`
+		Omap    map[string]string `ovsdb:"aMap"`
 	}
 
 	type test struct {
@@ -160,10 +160,10 @@ func TestMapperInfoSet(t *testing.T) {
 
 func TestMapperInfoColByPtr(t *testing.T) {
 	type obj struct {
-		ostring string            `ovs:"aString"`
-		oint    int               `ovs:"aInteger"`
-		oset    []string          `ovs:"aSet"`
-		omap    map[string]string `ovs:"aMap"`
+		ostring string            `ovsdb:"aString"`
+		oint    int               `ovsdb:"aInteger"`
+		oset    []string          `ovsdb:"aSet"`
+		omap    map[string]string `ovsdb:"aMap"`
 	}
 	obj1 := obj{}
 
@@ -269,11 +269,11 @@ func TestOrmGetIndex(t *testing.T) {
 	assert.Nil(t, err)
 
 	type obj struct {
-		ID     string            `ovs:"_uuid"`
-		MyName string            `ovs:"name"`
-		Config map[string]string `ovs:"config"`
-		Comp1  string            `ovs:"composed_1"`
-		Comp2  string            `ovs:"composed_2"`
+		ID     string            `ovsdb:"_uuid"`
+		MyName string            `ovsdb:"name"`
+		Config map[string]string `ovsdb:"config"`
+		Comp1  string            `ovsdb:"composed_1"`
+		Comp2  string            `ovsdb:"composed_2"`
 	}
 	type test struct {
 		name     string
diff --git a/mapper/mapper_test.go b/mapper/mapper_test.go
index 6afb04d..bb563b4 100644
--- a/mapper/mapper_test.go
+++ b/mapper/mapper_test.go
@@ -184,17 +184,17 @@ func getOvsTestRow(t *testing.T) ovsdb.Row {
 
 func TestMapperGetData(t *testing.T) {
 	type ormTestType struct {
-		AString             string            `ovs:"aString"`
-		ASet                []string          `ovs:"aSet"`
-		ASingleSet          []string          `ovs:"aSingleSet"`
-		AUUIDSet            []string          `ovs:"aUUIDSet"`
-		AUUID               string            `ovs:"aUUID"`
-		AIntSet             []int             `ovs:"aIntSet"`
-		AFloat              float64           `ovs:"aFloat"`
-		AFloatSet           []float64         `ovs:"aFloatSet"`
-		YetAnotherStringSet []string          `ovs:"aEmptySet"`
-		AEnum               string            `ovs:"aEnum"`
-		AMap                map[string]string `ovs:"aMap"`
+		AString             string            `ovsdb:"aString"`
+		ASet                []string          `ovsdb:"aSet"`
+		ASingleSet          []string          `ovsdb:"aSingleSet"`
+		AUUIDSet            []string          `ovsdb:"aUUIDSet"`
+		AUUID               string            `ovsdb:"aUUID"`
+		AIntSet             []int             `ovsdb:"aIntSet"`
+		AFloat              float64           `ovsdb:"aFloat"`
+		AFloatSet           []float64         `ovsdb:"aFloatSet"`
+		YetAnotherStringSet []string          `ovsdb:"aEmptySet"`
+		AEnum               string            `ovsdb:"aEnum"`
+		AMap                map[string]string `ovsdb:"aMap"`
 		NonTagged           string
 	}
 
@@ -247,7 +247,7 @@ func TestMapperNewRow(t *testing.T) {
 	}{{
 		name: "string",
 		objInput: &struct {
-			AString string `ovs:"aString"`
+			AString string `ovsdb:"aString"`
 		}{
 			AString: aString,
 		},
@@ -255,7 +255,7 @@ func TestMapperNewRow(t *testing.T) {
 	}, {
 		name: "set",
 		objInput: &struct {
-			SomeSet []string `ovs:"aSet"`
+			SomeSet []string `ovsdb:"aSet"`
 		}{
 			SomeSet: aSet,
 		},
@@ -263,7 +263,7 @@ func TestMapperNewRow(t *testing.T) {
 	}, {
 		name: "emptySet with no column specification",
 		objInput: &struct {
-			EmptySet []string `ovs:"aSet"`
+			EmptySet []string `ovsdb:"aSet"`
 		}{
 			EmptySet: []string{},
 		},
@@ -271,7 +271,7 @@ func TestMapperNewRow(t *testing.T) {
 	}, {
 		name: "UUID",
 		objInput: &struct {
-			MyUUID string `ovs:"aUUID"`
+			MyUUID string `ovsdb:"aUUID"`
 		}{
 			MyUUID: aUUID0,
 		},
@@ -279,7 +279,7 @@ func TestMapperNewRow(t *testing.T) {
 	}, {
 		name: "aUUIDSet",
 		objInput: &struct {
-			MyUUIDSet []string `ovs:"aUUIDSet"`
+			MyUUIDSet []string `ovsdb:"aUUIDSet"`
 		}{
 			MyUUIDSet: []string{aUUID0, aUUID1},
 		},
@@ -287,7 +287,7 @@ func TestMapperNewRow(t *testing.T) {
 	}, {
 		name: "aIntSet",
 		objInput: &struct {
-			MyIntSet []int `ovs:"aIntSet"`
+			MyIntSet []int `ovsdb:"aIntSet"`
 		}{
 			MyIntSet: []int{0, 42},
 		},
@@ -295,7 +295,7 @@ func TestMapperNewRow(t *testing.T) {
 	}, {
 		name: "aFloat",
 		objInput: &struct {
-			MyFloat float64 `ovs:"aFloat"`
+			MyFloat float64 `ovsdb:"aFloat"`
 		}{
 			MyFloat: 42.42,
 		},
@@ -303,7 +303,7 @@ func TestMapperNewRow(t *testing.T) {
 	}, {
 		name: "aFloatSet",
 		objInput: &struct {
-			MyFloatSet []float64 `ovs:"aFloatSet"`
+			MyFloatSet []float64 `ovsdb:"aFloatSet"`
 		}{
 			MyFloatSet: aFloatSet,
 		},
@@ -311,7 +311,7 @@ func TestMapperNewRow(t *testing.T) {
 	}, {
 		name: "Enum",
 		objInput: &struct {
-			MyEnum string `ovs:"aEnum"`
+			MyEnum string `ovsdb:"aEnum"`
 		}{
 			MyEnum: aEnum,
 		},
@@ -319,7 +319,7 @@ func TestMapperNewRow(t *testing.T) {
 	}, {
 		name: "untagged fields should not affect row",
 		objInput: &struct {
-			AString string `ovs:"aString"`
+			AString string `ovsdb:"aString"`
 			MyStuff map[string]string
 		}{
 			AString: aString,
@@ -329,7 +329,7 @@ func TestMapperNewRow(t *testing.T) {
 	}, {
 		name: "Maps",
 		objInput: &struct {
-			MyMap map[string]string `ovs:"aMap"`
+			MyMap map[string]string `ovsdb:"aMap"`
 		}{
 			MyMap: aMap,
 		},
@@ -357,10 +357,10 @@ func TestMapperNewRowFields(t *testing.T) {
 	}
 
 	type obj struct {
-		MyMap    map[string]string `ovs:"aMap"`
-		MySet    []string          `ovs:"aSet"`
-		MyString string            `ovs:"aString"`
-		MyFloat  float64           `ovs:"aFloat"`
+		MyMap    map[string]string `ovsdb:"aMap"`
+		MySet    []string          `ovsdb:"aSet"`
+		MyString string            `ovsdb:"aString"`
+		MyFloat  float64           `ovsdb:"aFloat"`
 	}
 	testObj := obj{}
 
@@ -476,11 +476,11 @@ func TestMapperCondition(t *testing.T) {
   }
 }`)
 	type testType struct {
-		ID     string            `ovs:"_uuid"`
-		MyName string            `ovs:"name"`
-		Config map[string]string `ovs:"config"`
-		Comp1  string            `ovs:"composed_1"`
-		Comp2  string            `ovs:"composed_2"`
+		ID     string            `ovsdb:"_uuid"`
+		MyName string            `ovsdb:"name"`
+		Config map[string]string `ovsdb:"config"`
+		Comp1  string            `ovsdb:"composed_1"`
+		Comp2  string            `ovsdb:"composed_2"`
 	}
 
 	var schema ovsdb.DatabaseSchema
@@ -645,13 +645,13 @@ func TestMapperEqualIndexes(t *testing.T) {
   }
 }`)
 	type testType struct {
-		ID     string            `ovs:"_uuid"`
-		MyName string            `ovs:"name"`
-		Config map[string]string `ovs:"config"`
-		Comp1  string            `ovs:"composed_1"`
-		Comp2  string            `ovs:"composed_2"`
-		Int1   int               `ovs:"int1"`
-		Int2   int               `ovs:"int2"`
+		ID     string            `ovsdb:"_uuid"`
+		MyName string            `ovsdb:"name"`
+		Config map[string]string `ovsdb:"config"`
+		Comp1  string            `ovsdb:"composed_1"`
+		Comp2  string            `ovsdb:"composed_2"`
+		Int1   int               `ovsdb:"int1"`
+		Int2   int               `ovsdb:"int2"`
 	}
 
 	var schema ovsdb.DatabaseSchema
@@ -904,12 +904,12 @@ func TestMapperMutation(t *testing.T) {
   }
 }`)
 	type testType struct {
-		UUID      string            `ovs:"_uuid"`
-		String    string            `ovs:"string"`
-		Set       []string          `ovs:"set"`
-		Map       map[string]string `ovs:"map"`
-		Int       int               `ovs:"int"`
-		UnMutable int               `ovs:"unmutable"`
+		UUID      string            `ovsdb:"_uuid"`
+		String    string            `ovsdb:"string"`
+		Set       []string          `ovsdb:"set"`
+		Map       map[string]string `ovsdb:"map"`
+		Int       int               `ovsdb:"int"`
+		UnMutable int               `ovsdb:"unmutable"`
 	}
 
 	var schema ovsdb.DatabaseSchema
diff --git a/model/model_test.go b/model/model_test.go
index 9044e94..3f97bf8 100644
--- a/model/model_test.go
+++ b/model/model_test.go
@@ -10,13 +10,13 @@ import (
 )
 
 type modelA struct {
-	UUID string `ovs:"_uuid"`
+	UUID string `ovsdb:"_uuid"`
 }
 
 type modelB struct {
-	UID string `ovs:"_uuid"`
-	Foo string `ovs:"bar"`
-	Bar string `ovs:"baz"`
+	UID string `ovsdb:"_uuid"`
+	Foo string `ovsdb:"bar"`
+	Bar string `ovsdb:"baz"`
 }
 
 type modelInvalid struct {
@@ -88,12 +88,12 @@ func TestSetUUID(t *testing.T) {
 func TestValidate(t *testing.T) {
 	model, err := NewDBModel("TestDB", map[string]Model{
 		"TestTable": &struct {
-			aUUID   string            `ovs:"_uuid"`
-			aString string            `ovs:"aString"`
-			aInt    int               `ovs:"aInt"`
-			aFloat  float64           `ovs:"aFloat"`
-			aSet    []string          `ovs:"aSet"`
-			aMap    map[string]string `ovs:"aMap"`
+			aUUID   string            `ovsdb:"_uuid"`
+			aString string            `ovsdb:"aString"`
+			aInt    int               `ovsdb:"aInt"`
+			aFloat  float64           `ovsdb:"aFloat"`
+			aSet    []string          `ovsdb:"aSet"`
+			aMap    map[string]string `ovsdb:"aMap"`
 		}{},
 	})
 	assert.Nil(t, err)
diff --git a/modelgen/table_test.go b/modelgen/table_test.go
index 1b12909..278c7fd 100644
--- a/modelgen/table_test.go
+++ b/modelgen/table_test.go
@@ -66,12 +66,12 @@ const (
 
 // AtomicTable defines an object in atomicTable table
 type AtomicTable struct {
-	UUID      string                ` + "`" + `ovs:"_uuid"` + "`" + `
-	EventType AtomicTableEventType  ` + "`" + `ovs:"event_type"` + "`" + `
-	Float     float64               ` + "`" + `ovs:"float"` + "`" + `
-	Int       int                   ` + "`" + `ovs:"int"` + "`" + `
-	Protocol  []AtomicTableProtocol ` + "`" + `ovs:"protocol"` + "`" + `
-	Str       string                ` + "`" + `ovs:"str"` + "`" + `
+	UUID      string                ` + "`" + `ovsdb:"_uuid"` + "`" + `
+	EventType AtomicTableEventType  ` + "`" + `ovsdb:"event_type"` + "`" + `
+	Float     float64               ` + "`" + `ovsdb:"float"` + "`" + `
+	Int       int                   ` + "`" + `ovsdb:"int"` + "`" + `
+	Protocol  []AtomicTableProtocol ` + "`" + `ovsdb:"protocol"` + "`" + `
+	Str       string                ` + "`" + `ovsdb:"str"` + "`" + `
 }
 `,
 		},
@@ -104,12 +104,12 @@ const (
 
 // AtomicTable defines an object in atomicTable table
 type AtomicTable struct {
-	UUID      string                ` + "`" + `ovs:"_uuid"` + "`" + `
-	EventType AtomicTableEventType  ` + "`" + `ovs:"event_type"` + "`" + `
-	Float     float64               ` + "`" + `ovs:"float"` + "`" + `
-	Int       int                   ` + "`" + `ovs:"int"` + "`" + `
-	Protocol  []AtomicTableProtocol ` + "`" + `ovs:"protocol"` + "`" + `
-	Str       string                ` + "`" + `ovs:"str"` + "`" + `
+	UUID      string                ` + "`" + `ovsdb:"_uuid"` + "`" + `
+	EventType AtomicTableEventType  ` + "`" + `ovsdb:"event_type"` + "`" + `
+	Float     float64               ` + "`" + `ovsdb:"float"` + "`" + `
+	Int       int                   ` + "`" + `ovsdb:"int"` + "`" + `
+	Protocol  []AtomicTableProtocol ` + "`" + `ovsdb:"protocol"` + "`" + `
+	Str       string                ` + "`" + `ovsdb:"str"` + "`" + `
 
 	OtherUUID      string
 	OtherEventType AtomicTableEventType
@@ -153,12 +153,12 @@ const (
 
 // AtomicTable defines an object in atomicTable table
 type AtomicTable struct {
-	UUID      string                ` + "`" + `ovs:"_uuid"` + "`" + `
-	EventType AtomicTableEventType  ` + "`" + `ovs:"event_type"` + "`" + `
-	Float     float64               ` + "`" + `ovs:"float"` + "`" + `
-	Int       int                   ` + "`" + `ovs:"int"` + "`" + `
-	Protocol  []AtomicTableProtocol ` + "`" + `ovs:"protocol"` + "`" + `
-	Str       string                ` + "`" + `ovs:"str"` + "`" + `
+	UUID      string                ` + "`" + `ovsdb:"_uuid"` + "`" + `
+	EventType AtomicTableEventType  ` + "`" + `ovsdb:"event_type"` + "`" + `
+	Float     float64               ` + "`" + `ovsdb:"float"` + "`" + `
+	Int       int                   ` + "`" + `ovsdb:"int"` + "`" + `
+	Protocol  []AtomicTableProtocol ` + "`" + `ovsdb:"protocol"` + "`" + `
+	Str       string                ` + "`" + `ovsdb:"str"` + "`" + `
 }
 
 func TestFunc() string {
@@ -277,8 +277,8 @@ func TestAtomicType(t *testing.T) {
 }
 
 func TestTag(t *testing.T) {
-	if s := Tag("Foo_Bar"); s != "ovs:\"Foo_Bar\"" {
-		t.Fatalf("got %s, wanted ovs:\"Foo_Bar\"", s)
+	if s := Tag("Foo_Bar"); s != "ovsdb:\"Foo_Bar\"" {
+		t.Fatalf("got %s, wanted ovsdb:\"Foo_Bar\"", s)
 	}
 }
 
diff --git a/server/server_integration_test.go b/server/server_integration_test.go
index d2644d4..7fdec6d 100644
--- a/server/server_integration_test.go
+++ b/server/server_integration_test.go
@@ -20,18 +20,18 @@ import (
 
 // bridgeType is the simplified ORM model of the Bridge table
 type bridgeType struct {
-	UUID        string            `ovs:"_uuid"`
-	Name        string            `ovs:"name"`
-	OtherConfig map[string]string `ovs:"other_config"`
-	ExternalIds map[string]string `ovs:"external_ids"`
-	Ports       []string          `ovs:"ports"`
-	Status      map[string]string `ovs:"status"`
+	UUID        string            `ovsdb:"_uuid"`
+	Name        string            `ovsdb:"name"`
+	OtherConfig map[string]string `ovsdb:"other_config"`
+	ExternalIds map[string]string `ovsdb:"external_ids"`
+	Ports       []string          `ovsdb:"ports"`
+	Status      map[string]string `ovsdb:"status"`
 }
 
 // ovsType is the simplified ORM model of the Bridge table
 type ovsType struct {
-	UUID    string   `ovs:"_uuid"`
-	Bridges []string `ovs:"bridges"`
+	UUID    string   `ovsdb:"_uuid"`
+	Bridges []string `ovsdb:"bridges"`
 }
 
 func getSchema() (*ovsdb.DatabaseSchema, error) {