xormplus 10 anni fa
parent
commit
0b1e86c720
1 ha cambiato i file con 8 aggiunte e 0 eliminazioni
  1. 8 0
      test/xorm_test.go

+ 8 - 0
test/xorm_test.go

@@ -88,6 +88,14 @@ func Test_FindAll_Json(t *testing.T) {
 	t.Log("[Test_FindAll_Json]->rows:\n" + rows)
 	t.Log("[Test_FindAll_Json]->rows:\n" + rows)
 }
 }
 
 
+func Test_FindAll_ID(t *testing.T) {
+	rows := db.Sql("select id,title,createdatetime,content from article where id = ?", 2).FindAll()
+	if rows.Err != nil {
+		t.Fatal(rows.Err)
+	}
+	t.Log("[Test_FindAll_Json]->rows[0][\"id\"]:\n" , rows.Result[0]["id"])
+}
+
 func Test_FindAll_Xml(t *testing.T) {
 func Test_FindAll_Xml(t *testing.T) {
 	rows, err := db.Sql("select id,title,createdatetime,content from article where id = ?", 2).FindAll().Xml()
 	rows, err := db.Sql("select id,title,createdatetime,content from article where id = ?", 2).FindAll().Xml()
 	if err != nil {
 	if err != nil {