             XCTAssertEqual(literal.arguments, ["foo"])
         }
     }
+    
+    func testCodingKeysAsColumnExpression() throws {
+        struct Player: Codable, TableRecord, FetchableRecord, PersistableRecord {
+            var id: Int64
+            var name: String
+            var score: Int
+            
+            enum CodingKeys: String, CodingKey, ColumnExpression {
+                case id
+                case name = "full_name"
+                case score
+            }
+            
+            // Test databaseSelection
+            static let databaseSelection: [SQLSelectable] = [CodingKeys.id, CodingKeys.name, CodingKeys.score]
+            
+            static var testRequest: QueryInterfaceRequest<Player> {
+                // Test expression derivation
+                return filter(CodingKeys.name != nil).order(CodingKeys.score.desc)
+            }
+        }
+        
+        let dbQueue = try makeDatabaseQueue()
+        try dbQueue.inDatabase { db in
+            try db.create(table: "player") { t in
+                t.autoIncrementedPrimaryKey("id")
+                t.column("full_name")
+                t.column("score")
+            }
+            
+            // Test rowId column identification
+            try XCTAssertEqual(Player.filter(key: 1).databaseRegion(db).description, "player(full_name,id,score)[1]")
+            try XCTAssertEqual(Player.filter(Player.CodingKeys.id == 1).databaseRegion(db).description, "player(full_name,id,score)[1]")
+            try XCTAssertEqual(Player.filter(1 == Player.CodingKeys.id).databaseRegion(db).description, "player(full_name,id,score)[1]")
+            try XCTAssertEqual(Player.filter(Player.CodingKeys.id == 1 || Player.CodingKeys.id == 2).databaseRegion(db).description, "player(full_name,id,score)[1,2]")
+            try XCTAssertEqual(Player.filter([1, 2, 3].contains(Player.CodingKeys.id)).databaseRegion(db).description, "player(full_name,id,score)[1,2,3]")
+            
+            // Test specific column updates
+            let player = Player(row: ["id": 1, "full_name": "Arthur", "score": 1000])
+            try? player.update(db, columns: [Player.CodingKeys.name, Player.CodingKeys.score])
+            XCTAssertEqual(lastSQLQuery, "UPDATE \"player\" SET \"full_name\"=\'Arthur\', \"score\"=1000 WHERE \"id\"=1")
+            
+            // Test FTS3 match expression
+            let expression = try Player.CodingKeys.name.match(FTS3Pattern(rawPattern: "foo"))
+            let literal = expression.literal
+            XCTAssertEqual(literal.sql, "(\"full_name\" MATCH ?)")
+            XCTAssertEqual(literal.arguments, ["foo"])
+        }
+    }
 }

        
        let dbQueue = try makeDatabaseQueue()
        try dbQueue.inDatabase { db in
            try db.create(table: "players") { t in
                t.autoIncrementedPrimaryKey("id")
                t.column("name")
                t.column("score")
            }
            
            // Test rowId column identification
            try XCTAssertEqual(Player.filter(key: 1).databaseRegion(db).description, "players(id,name,score)[1]")
            try XCTAssertEqual(Player.filter(Player.Columns.id == 1).databaseRegion(db).description, "players(id,name,score)[1]")
            try XCTAssertEqual(Player.filter(1 == Player.Columns.id).databaseRegion(db).description, "players(id,name,score)[1]")
            try XCTAssertEqual(Player.filter(Player.Columns.id == 1 || Player.Columns.id == 2).databaseRegion(db).description, "players(id,name,score)[1,2]")
            try XCTAssertEqual(Player.filter([1, 2, 3].contains(Player.Columns.id)).databaseRegion(db).description, "players(id,name,score)[1,2,3]")
            
            // Test specific column updates
            let player = Player(row: ["id": 1, "name": "Arthur", "score": 1000])
            try? player.update(db, columns: [Player.Columns.name, Player.Columns.score])
            XCTAssertEqual(lastSQLQuery, "UPDATE \"players\" SET \"name\"=\'Arthur\', \"score\"=1000 WHERE \"id\"=1")
            
            // Test FTS3 match expression
            let expression = try Player.Columns.name.match(FTS3Pattern(rawPattern: "foo"))

                static let score = Player.Column(name: "score")
            }
            
            // Test databaseSelection
            static let databaseSelection: [SQLSelectable] = [Columns.id, Columns.name, Columns.score]
            
