@@ -553,13 +553,19 @@ type internal SQLiteProvider(resolutionPath, contextSchemaPath, referencedAssemb
553553 match findDbType dt with
554554 | Some( m) ->
555555 let pkColumn = reader.GetBoolean( 5 )
556+ // Check if column is generated/computed (hidden column in pragma table_info is 6)
557+ let isComputed =
558+ try
559+ if reader.FieldCount > 6 then ( reader.GetInt32 6 ) > 0
560+ else false
561+ with _ -> false
556562 let col =
557563 { Column.Name = colName
558564 TypeMapping = m
559565 IsNullable = not <| reader.GetBoolean( 3 );
560566 IsPrimaryKey = pkColumn
561567 IsAutonumber = pkColumn
562- IsComputed = false
568+ IsComputed = isComputed
563569 HasDefault = not ( reader.IsDBNull 4 )
564570 TypeInfo = ValueSome dtv }
565571 if col.IsPrimaryKey then
@@ -686,6 +692,10 @@ type internal SQLiteProvider(resolutionPath, contextSchemaPath, referencedAssemb
686692 | Length -> sprintf " LENGTH(%s )" column
687693 | IndexOf( SqlConstant search) -> sprintf " INSTR(%s ,%s )" column ( fieldParam search)
688694 | IndexOf( SqlCol( al2, col2)) -> sprintf " INSTR(%s ,%s )" column ( fieldNotation al2 col2)
695+ | IndexOfStart( SqlConstant search, SqlConstant startPos) -> sprintf " CASE WHEN INSTR(SUBSTR(%s , %s ), %s ) > 0 THEN INSTR(SUBSTR(%s , %s ), %s ) + %s - 1 ELSE 0 END" column ( fieldParam startPos) ( fieldParam search) column ( fieldParam startPos) ( fieldParam search) ( fieldParam startPos)
696+ | IndexOfStart( SqlConstant search, SqlCol( al2, col2)) -> sprintf " CASE WHEN INSTR(SUBSTR(%s , %s ), %s ) > 0 THEN INSTR(SUBSTR(%s , %s ), %s ) + %s - 1 ELSE 0 END" column ( fieldNotation al2 col2) ( fieldParam search) column ( fieldNotation al2 col2) ( fieldParam search) ( fieldNotation al2 col2)
697+ | IndexOfStart( SqlCol( al2, col2), SqlConstant startPos) -> sprintf " CASE WHEN INSTR(SUBSTR(%s , %s ), %s ) > 0 THEN INSTR(SUBSTR(%s , %s ), %s ) + %s - 1 ELSE 0 END" column ( fieldParam startPos) ( fieldNotation al2 col2) column ( fieldParam startPos) ( fieldNotation al2 col2) ( fieldParam startPos)
698+ | IndexOfStart( SqlCol( al2, col2), SqlCol( al3, col3)) -> sprintf " CASE WHEN INSTR(SUBSTR(%s , %s ), %s ) > 0 THEN INSTR(SUBSTR(%s , %s ), %s ) + %s - 1 ELSE 0 END" column ( fieldNotation al3 col3) ( fieldNotation al2 col2) column ( fieldNotation al3 col3) ( fieldNotation al2 col2) ( fieldNotation al3 col3)
689699 | CastVarchar -> sprintf " CAST(%s AS TEXT)" column
690700 | CastInt -> sprintf " CAST(%s AS INTEGER)" column
691701 // Date functions
0 commit comments