vesper-framework/vesper

Question: Is SQL generation correct?

iamgmd opened this issue · 0 comments

I have two entities, Solution and SolutionComponent. Solution has a OneToMany relationship with SolutionComponent and SolutionComponent has ManyToOne relationship to Solution as required by TypeORM.

Solution

  @OneToMany(() => SolutionComponent, solutionComponent => solutionComponent.solutionid_ref)
  @JoinColumn({ name: "solutionid" })
  solutioncomponent_refs: [SolutionComponent];

SolutionComponent

  @ManyToOne(() => Solution, solution => solution.solutioncomponent_refs)
  @JoinColumn({ name: "solutionid" })
  solutionid_ref: Solution;

In the SolutionController I have a standard entityManager find statement.

    @Query()
    solution_all(): Promise<Solution[]> {
        return this.entityManager.find(Solution);
    }

And run this query using the following GraphQL query on mssql.

{
  solution_all {
    solutionid
    solutioncomponent_refs {
      solutioncomponentid
    }
  }
}

Sorry for the long output but necessary. This generates the following 3 T-SQL queries and takes approx 1 minute to run.

query: SELECT "Solution"."configurationpageid" AS "Solution_configurationpageid", "Solution"."createdby" AS "Solution_createdby", "Solution"."createdon" AS "Solution_createdon", "Solution"."createdonbehalfby" AS "Solution_createdonbehalfby", "Solution"."description" AS "Solution_description", "Solution"."friendlyname" AS "Solution_friendlyname", "Solution"."installedon" AS "Solution_installedon", "Solution"."isinternal" AS "Solution_isinternal", "Solution"."ismanaged" AS "Solution_ismanaged", "Solution"."isvisible" AS "Solution_isvisible", "Solution"."modifiedby" AS "Solution_modifiedby", "Solution"."modifiedon" AS "Solution_modifiedon", "Solution"."modifiedonbehalfby" AS "Solution_modifiedonbehalfby", "Solution"."organizationid" AS "Solution_organizationid", "Solution"."parentsolutionid" AS "Solution_parentsolutionid", "Solution"."pinpointassetid" AS "Solution_pinpointassetid", "Solution"."pinpointsolutiondefaultlocale" AS "Solution_pinpointsolutiondefaultlocale", "Solution"."pinpointsolutionid" AS "Solution_pinpointsolutionid", "Solution"."publisherid" AS "Solution_publisherid", "Solution"."solutionid" AS "Solution_solutionid", "Solution"."solutionpackageversion" AS "Solution_solutionpackageversion", "Solution"."solutiontype" AS "Solution_solutiontype", "Solution"."uniquename" AS "Solution_uniquename", "Solution"."version" AS "Solution_version", "Solution"."versionnumber" AS "Solution_versionnumber" FROM "solutionbase" "Solution"

query: SELECT "solutioncomponent_refs"."componenttype" AS "solutioncomponent_refs_componenttype", "solutioncomponent_refs"."createdby" AS "solutioncomponent_refs_createdby", "solutioncomponent_refs"."createdon" AS "solutioncomponent_refs_createdon", "solutioncomponent_refs"."createdonbehalfby" AS "solutioncomponent_refs_createdonbehalfby", "solutioncomponent_refs"."ismetadata" AS "solutioncomponent_refs_ismetadata", "solutioncomponent_refs"."modifiedby" AS "solutioncomponent_refs_modifiedby", "solutioncomponent_refs"."modifiedon" AS "solutioncomponent_refs_modifiedon", "solutioncomponent_refs"."modifiedonbehalfby" AS "solutioncomponent_refs_modifiedonbehalfby", "solutioncomponent_refs"."objectid" AS "solutioncomponent_refs_objectid", "solutioncomponent_refs"."rootcomponentbehavior" AS "solutioncomponent_refs_rootcomponentbehavior", "solutioncomponent_refs"."rootsolutioncomponentid" AS "solutioncomponent_refs_rootsolutioncomponentid", "solutioncomponent_refs"."solutioncomponentid" AS "solutioncomponent_refs_solutioncomponentid", "solutioncomponent_refs"."solutionid" AS "solutioncomponent_refs_solutionid", "solutioncomponent_refs"."versionnumber" AS "solutioncomponent_refs_versionnumber" FROM "solutioncomponentbase" "solutioncomponent_refs" WHERE "solutioncomponent_refs"."solutionid" IN (@0, @1, @2, @3, @4, @5, @6, @7, @8, @9, @10, @11, @12, @13, @14, @15, @16, @17, @18, @19, @20, @21, @22, @23, @24, @25, @26, @27, @28, @29, @30, @31, @32, @33, @34, @35, @36, @37, @38, @39, @40, @41, @42, @43, @44, @45, @46, @47, @48, @49, @50, @51, @52, @53, @54, @55, @56, @57, @58, @59, @60, @61, @62, @63, @64, @65, @66, @67, @68, @69, @70, @71, @72, @73, @74, @75, @76, @77, @78, @79, @80, @81, @82, @83, @84, @85, @86, @87, @88, @89, @90, @91, @92, @93, @94, @95, @96, @97, @98, @99, @100, @101, @102, @103, @104, @105, @106, @107, @108, @109, @110, @111, @112, @113, @114, @115, @116, @117, @118, @119, @120, @121, @122, @123, @124, @125, @126, @127, @128, @129, @130) -- PARAMETERS: ["FD140AAD-4DF4-11DD-BD17-0019B9312238","FD140AAE-4DF4-11DD-BD17-0019B9312238","FD140AAF-4DF4-11DD-BD17-0019B9312238","D83099BC-67BF-E511-80C1-005056930C8E","83CB08CD-28CF-E511-80C3-005056930C8E","2ABCA093-3DCF-E511-80C3-005056930C8E","055FD054-9CD4-E511-80C5-005056930C8E","91D975F4-A0D4-E511-80C5-005056930C8E","FBCE987E-CFDF-E511-80CA-005056930C8E","B98664BC-5EE4-E511-80CA-005056930C8E","419E178B-6AE4-E511-80CA-005056930C8E","BC8869E6-DCE5-E511-80CA-005056930C8E","A28480F9-6BE7-E511-80CA-005056930C8E","203136CB-86EF-E511-80CA-005056930C8E","51D3BFCE-DF15-E611-80CB-005056930C8E","1A95E991-DE1C-E611-80CB-005056930C8E","85775DC9-8D3F-E611-80CF-005056930C8E","A2C7A145-2F44-E611-80D2-005056930C8E","C8B047D0-C849-E611-80D3-005056930C8E","A3E03268-0D5F-E611-80D3-005056930C8E","634C20BC-5C6C-E611-80D3-005056930C8E","5BF449CD-12A0-E611-80D3-005056930C8E","15D88CBE-D1A1-E611-80D3-005056930C8E","2F3D5987-20E3-E611-80D9-005056930C8E","8720EF42-7AEC-E611-80D9-005056930C8E","2F1AFE57-54F8-E611-80DA-005056930C8E","0BF71A63-DAFC-E611-80DA-005056930C8E","227742A4-69FF-E611-80DA-005056930C8E","4742F634-2B0F-E711-80DB-005056930C8E","9F88B2AD-9110-E711-80DB-005056930C8E","14F22083-0A1A-E711-80DC-005056930C8E","D0832DF6-A41A-E711-80DC-005056930C8E","2005CAC8-DB3A-E711-80E0-005056930C8E","99434124-4D41-E711-80E0-005056930C8E","7A5EB4B1-1566-E711-80E1-005056930C8E","DF649B0E-7C7B-E711-80E1-005056930C8E","A53AB1EF-E296-E711-80EB-005056930C8E","3FAA8010-309F-E711-80EC-005056930C8E","51F51093-EAA4-E711-80EC-005056930C8E","6AA1C216-60BD-E711-80ED-005056930C8E","6BDF76BA-E4CD-E711-80F1-005056930C8E","24A6E64E-F5CD-E711-80F1-005056930C8E","2058FE3D-D4D9-E711-80F1-005056930C8E","889BA297-0CE7-E711-80F3-005056930C8E","D27731D1-E9F5-E711-80F3-005056930C8E","56C5ACB1-D9FA-E711-80F3-005056930C8E","4D90ED2C-3200-E811-80F4-005056930C8E","039BCC7D-FC04-E811-80F4-005056930C8E","FE7D70C9-1E0B-E811-80F5-005056930C8E","593904A1-610B-E811-80F5-005056930C8E","B409B63A-E60F-E811-80F5-005056930C8E","C619CF31-D117-E811-80F5-005056930C8E","957DFFCE-F21A-E811-80F6-005056930C8E","EECC742F-B71B-E811-80F6-005056930C8E","02111F1A-F521-E811-80F6-005056930C8E","7A7FD78C-8E23-E811-80F6-005056930C8E","F6F429C2-6F39-E811-80F7-005056930C8E","57078624-893D-E811-80FA-005056930C8E","AA8FB495-8641-E811-80FD-005056930C8E","8632EA82-1D43-E811-80FD-005056930C8E","6D1A5102-6048-E811-80FD-005056930C8E","F43554BE-864C-E811-80FD-005056930C8E","777D748C-8F4C-E811-80FD-005056930C8E","7117AEE4-D14E-E811-80FD-005056930C8E","D46248E4-8707-E411-BB07-005056C00008","A8BEB096-6B0E-E411-BB07-005056C00008","03109BA6-F541-4194-A230-0392ABAEA641","25A01723-9F63-4449-A3E0-046CC23A2902","0D265B52-DC31-4960-9925-074279A0B6D5","94BAF356-DB62-4EC9-BF28-0A1D2F1DBDD8","1CEEF079-F870-42AD-94CC-13A530CA5C88","8C8CBD10-2E5B-4401-9921-1582B6DE60E4","C6411348-41D0-408F-8C3D-1DF24B5A83F6","62DED6B9-4B76-4EB8-AF4C-255EA9773FB7","6A999E1E-8CE6-4475-81B2-25DEDF21A9C1","4CF405C0-F1BA-4914-85D3-2936237328CE","23BA9D0E-E3F6-4A81-92FB-2F80EFC108A5","7A649F8B-C74C-4CA3-BAC6-356DFB9F17AE","7749B0ED-CDF1-4819-ACB6-3DA9FB7B8ECF","5FC67456-D4EB-4FDD-93D3-3DAB820ED9A8","C514D95B-637B-40E6-9C11-435DA249757A","2465535D-3F77-4330-B76B-473CBE2A1AE9","32E0E5F3-3C84-4849-98A5-558B19874583","57A85212-B3B4-4C39-BCB0-5D5EF1F5FFC4","5A94B2B3-CE0C-4B81-9EE8-62BD3A010FF8","7EF6BDF7-2F37-4A1B-896B-62C33FAE1B55","750E621B-D4B8-410B-A003-7500EE65569F","DA800266-C402-4244-96C7-76F1B3235BF5","3D1BC26E-42D6-4D38-AB36-77462E08C696","557DAE4D-AB50-E111-98D8-782BCB776B8B","CA8EDDA0-6851-E111-98D8-782BCB776B8B","83869108-D438-E411-81E7-782BCB776B8C","26B47A2F-D94E-E411-81E7-782BCB776B8C","8F07D3EF-F758-E411-81E7-782BCB776B8C","EA5977EC-66D3-E211-8B26-782BCB776B8C","0FA23C60-EF82-E111-8FA3-782BCB776B8C","A863C122-4F1F-E211-9680-782BCB776B8C","BE4BD90F-1FB1-E411-9837-782BCB776B8C","177CD169-8EB2-E411-9837-782BCB776B8C","F2BA4CFC-25B8-E411-9837-782BCB776B8C","DAA8C853-39D9-E411-9B4F-782BCB776B8C","93646E7F-02DD-E411-9B4F-782BCB776B8C","31EA2187-32E4-E411-9B4F-782BCB776B8C","1918C834-9AF8-E411-9B4F-782BCB776B8C","D867CA6A-4804-E511-9B4F-782BCB776B8C","52A1C91E-2314-E511-9B4F-782BCB776B8C","B71D9424-E740-E511-9D3B-782BCB776B8C","8CA7CAE0-9D4C-E511-9D3B-782BCB776B8C","32BEC5B3-E84C-E511-9D3B-782BCB776B8C","42EAB3FD-9AA3-E411-B32F-782BCB776B8C","CBB9C768-C892-466E-8E0F-798B820DB8B1","026EBEDE-228E-473E-81FB-7CF5A56ABB5D","92B512F8-CAAE-450E-9A10-884D7545FE95","2B485265-350F-4706-BC94-8A22DDE75203","1A1CFB89-91E9-4BC3-B750-950263B723FE","3080E288-2E67-4BA7-B9E9-979D89E99039","D0BC3831-8F1B-4EC0-A380-9E1795CBD2E0","BCEBC82D-4C1D-48ED-9389-AA7937977654","5A43A936-2324-4469-9FAC-B3FAB5F117BF","B5BD1472-1F86-4B3A-ACC2-B510F5BD0D67","62D5948B-F118-4658-A6B2-CFF0AED89C97","03E346C6-17CC-4A17-B567-D2318D0803F6","4D3BBA9E-94A1-4BB6-B772-DBC4ADECBD49","92696DB3-642D-4382-BD8C-DC08CCD9946C","80A44453-3286-4DEA-AF6C-DDDA949DF15D","DD569DED-790E-4C0B-A31A-DFC786C80F02","1D31335C-0F8F-4B7D-9252-E3062103C8C0","7D76EC81-68D3-4BB5-B668-E4DA52E6922A","93E09BEC-AFAF-4F41-A74A-EF853172A75A","764D5B4E-77BE-4CB7-81A0-F51724816061","B1516D26-A644-4DCC-BA30-FF2339D957C5"]

query: SELECT "SolutionComponent"."solutioncomponentid" AS "SolutionComponent_solutioncomponent_refs_solutioncomponentid", "SolutionComponent"."solutionid" AS "Solution_solutionid" FROM "solutioncomponentbase" "SolutionComponent" WHERE "SolutionComponent"."solutionid" IN (@0, @1, @2, @3, @4, @5, @6, @7, @8, @9, @10, @11, @12, @13, @14, @15, @16, @17, @18, @19, @20, @21, @22, @23, @24, @25, @26, @27, @28, @29, @30, @31, @32, @33, @34, @35, @36, @37, @38, @39, @40, @41, @42, @43, @44, @45, @46, @47, @48, @49, @50, @51, @52, @53, @54, @55, @56, @57, @58, @59, @60, @61, @62, @63, @64, @65, @66, @67, @68, @69, @70, @71, @72, @73, @74, @75, @76, @77, @78, @79, @80, @81, @82, @83, @84, @85, @86, @87, @88, @89, @90, @91, @92, @93, @94, @95, @96, @97, @98, @99, @100, @101, @102, @103, @104, @105, @106, @107, @108, @109, @110, @111, @112, @113, @114, @115, @116, @117, @118, @119, @120, @121, @122, @123, @124, @125, @126, @127, @128, @129, @130) -- PARAMETERS: ["FD140AAD-4DF4-11DD-BD17-0019B9312238","FD140AAE-4DF4-11DD-BD17-0019B9312238","FD140AAF-4DF4-11DD-BD17-0019B9312238","D83099BC-67BF-E511-80C1-005056930C8E","83CB08CD-28CF-E511-80C3-005056930C8E","2ABCA093-3DCF-E511-80C3-005056930C8E","055FD054-9CD4-E511-80C5-005056930C8E","91D975F4-A0D4-E511-80C5-005056930C8E","FBCE987E-CFDF-E511-80CA-005056930C8E","B98664BC-5EE4-E511-80CA-005056930C8E","419E178B-6AE4-E511-80CA-005056930C8E","BC8869E6-DCE5-E511-80CA-005056930C8E","A28480F9-6BE7-E511-80CA-005056930C8E","203136CB-86EF-E511-80CA-005056930C8E","51D3BFCE-DF15-E611-80CB-005056930C8E","1A95E991-DE1C-E611-80CB-005056930C8E","85775DC9-8D3F-E611-80CF-005056930C8E","A2C7A145-2F44-E611-80D2-005056930C8E","C8B047D0-C849-E611-80D3-005056930C8E","A3E03268-0D5F-E611-80D3-005056930C8E","634C20BC-5C6C-E611-80D3-005056930C8E","5BF449CD-12A0-E611-80D3-005056930C8E","15D88CBE-D1A1-E611-80D3-005056930C8E","2F3D5987-20E3-E611-80D9-005056930C8E","8720EF42-7AEC-E611-80D9-005056930C8E","2F1AFE57-54F8-E611-80DA-005056930C8E","0BF71A63-DAFC-E611-80DA-005056930C8E","227742A4-69FF-E611-80DA-005056930C8E","4742F634-2B0F-E711-80DB-005056930C8E","9F88B2AD-9110-E711-80DB-005056930C8E","14F22083-0A1A-E711-80DC-005056930C8E","D0832DF6-A41A-E711-80DC-005056930C8E","2005CAC8-DB3A-E711-80E0-005056930C8E","99434124-4D41-E711-80E0-005056930C8E","7A5EB4B1-1566-E711-80E1-005056930C8E","DF649B0E-7C7B-E711-80E1-005056930C8E","A53AB1EF-E296-E711-80EB-005056930C8E","3FAA8010-309F-E711-80EC-005056930C8E","51F51093-EAA4-E711-80EC-005056930C8E","6AA1C216-60BD-E711-80ED-005056930C8E","6BDF76BA-E4CD-E711-80F1-005056930C8E","24A6E64E-F5CD-E711-80F1-005056930C8E","2058FE3D-D4D9-E711-80F1-005056930C8E","889BA297-0CE7-E711-80F3-005056930C8E","D27731D1-E9F5-E711-80F3-005056930C8E","56C5ACB1-D9FA-E711-80F3-005056930C8E","4D90ED2C-3200-E811-80F4-005056930C8E","039BCC7D-FC04-E811-80F4-005056930C8E","FE7D70C9-1E0B-E811-80F5-005056930C8E","593904A1-610B-E811-80F5-005056930C8E","B409B63A-E60F-E811-80F5-005056930C8E","C619CF31-D117-E811-80F5-005056930C8E","957DFFCE-F21A-E811-80F6-005056930C8E","EECC742F-B71B-E811-80F6-005056930C8E","02111F1A-F521-E811-80F6-005056930C8E","7A7FD78C-8E23-E811-80F6-005056930C8E","F6F429C2-6F39-E811-80F7-005056930C8E","57078624-893D-E811-80FA-005056930C8E","AA8FB495-8641-E811-80FD-005056930C8E","8632EA82-1D43-E811-80FD-005056930C8E","6D1A5102-6048-E811-80FD-005056930C8E","F43554BE-864C-E811-80FD-005056930C8E","777D748C-8F4C-E811-80FD-005056930C8E","7117AEE4-D14E-E811-80FD-005056930C8E","D46248E4-8707-E411-BB07-005056C00008","A8BEB096-6B0E-E411-BB07-005056C00008","03109BA6-F541-4194-A230-0392ABAEA641","25A01723-9F63-4449-A3E0-046CC23A2902","0D265B52-DC31-4960-9925-074279A0B6D5","94BAF356-DB62-4EC9-BF28-0A1D2F1DBDD8","1CEEF079-F870-42AD-94CC-13A530CA5C88","8C8CBD10-2E5B-4401-9921-1582B6DE60E4","C6411348-41D0-408F-8C3D-1DF24B5A83F6","62DED6B9-4B76-4EB8-AF4C-255EA9773FB7","6A999E1E-8CE6-4475-81B2-25DEDF21A9C1","4CF405C0-F1BA-4914-85D3-2936237328CE","23BA9D0E-E3F6-4A81-92FB-2F80EFC108A5","7A649F8B-C74C-4CA3-BAC6-356DFB9F17AE","7749B0ED-CDF1-4819-ACB6-3DA9FB7B8ECF","5FC67456-D4EB-4FDD-93D3-3DAB820ED9A8","C514D95B-637B-40E6-9C11-435DA249757A","2465535D-3F77-4330-B76B-473CBE2A1AE9","32E0E5F3-3C84-4849-98A5-558B19874583","57A85212-B3B4-4C39-BCB0-5D5EF1F5FFC4","5A94B2B3-CE0C-4B81-9EE8-62BD3A010FF8","7EF6BDF7-2F37-4A1B-896B-62C33FAE1B55","750E621B-D4B8-410B-A003-7500EE65569F","DA800266-C402-4244-96C7-76F1B3235BF5","3D1BC26E-42D6-4D38-AB36-77462E08C696","557DAE4D-AB50-E111-98D8-782BCB776B8B","CA8EDDA0-6851-E111-98D8-782BCB776B8B","83869108-D438-E411-81E7-782BCB776B8C","26B47A2F-D94E-E411-81E7-782BCB776B8C","8F07D3EF-F758-E411-81E7-782BCB776B8C","EA5977EC-66D3-E211-8B26-782BCB776B8C","0FA23C60-EF82-E111-8FA3-782BCB776B8C","A863C122-4F1F-E211-9680-782BCB776B8C","BE4BD90F-1FB1-E411-9837-782BCB776B8C","177CD169-8EB2-E411-9837-782BCB776B8C","F2BA4CFC-25B8-E411-9837-782BCB776B8C","DAA8C853-39D9-E411-9B4F-782BCB776B8C","93646E7F-02DD-E411-9B4F-782BCB776B8C","31EA2187-32E4-E411-9B4F-782BCB776B8C","1918C834-9AF8-E411-9B4F-782BCB776B8C","D867CA6A-4804-E511-9B4F-782BCB776B8C","52A1C91E-2314-E511-9B4F-782BCB776B8C","B71D9424-E740-E511-9D3B-782BCB776B8C","8CA7CAE0-9D4C-E511-9D3B-782BCB776B8C","32BEC5B3-E84C-E511-9D3B-782BCB776B8C","42EAB3FD-9AA3-E411-B32F-782BCB776B8C","CBB9C768-C892-466E-8E0F-798B820DB8B1","026EBEDE-228E-473E-81FB-7CF5A56ABB5D","92B512F8-CAAE-450E-9A10-884D7545FE95","2B485265-350F-4706-BC94-8A22DDE75203","1A1CFB89-91E9-4BC3-B750-950263B723FE","3080E288-2E67-4BA7-B9E9-979D89E99039","D0BC3831-8F1B-4EC0-A380-9E1795CBD2E0","BCEBC82D-4C1D-48ED-9389-AA7937977654","5A43A936-2324-4469-9FAC-B3FAB5F117BF","B5BD1472-1F86-4B3A-ACC2-B510F5BD0D67","62D5948B-F118-4658-A6B2-CFF0AED89C97","03E346C6-17CC-4A17-B567-D2318D0803F6","4D3BBA9E-94A1-4BB6-B772-DBC4ADECBD49","92696DB3-642D-4382-BD8C-DC08CCD9946C","80A44453-3286-4DEA-AF6C-DDDA949DF15D","DD569DED-790E-4C0B-A31A-DFC786C80F02","1D31335C-0F8F-4B7D-9252-E3062103C8C0","7D76EC81-68D3-4BB5-B668-E4DA52E6922A","93E09BEC-AFAF-4F41-A74A-EF853172A75A","764D5B4E-77BE-4CB7-81A0-F51724816061","B1516D26-A644-4DCC-BA30-FF2339D957C5"]

On a GraphQL project without vesper but using typeORM I run the same query using the following syntax.

      const records = await connection.manager
        .find(Solution, {
          relations: [
            "solutioncomponent_refs"
          ]
        })
        .catch(error => {
          connection.close();
          throw error as Error;
        });
      await connection.close();

This generates the following single query which runs in approx 1.5 seconds so why does vesper create 3 queries when typeORM generates 1 on it's native entityManager ?

query: SELECT "Solution"."configurationpageid" AS "Solution_configurationpageid", "Solution"."createdby" AS "Solution_createdby", "Solution"."createdon" AS "Solution_createdon", "Solution"."createdonbehalfby" AS "Solution_createdonbehalfby", "Solution"."description" AS "Solution_description", "Solution"."friendlyname" AS "Solution_friendlyname", "Solution"."installedon" AS "Solution_installedon", "Solution"."isinternal" AS "Solution_isinternal", "Solution"."ismanaged" AS "Solution_ismanaged", "Solution"."isvisible" AS "Solution_isvisible", "Solution"."modifiedby" AS "Solution_modifiedby", "Solution"."modifiedon" AS "Solution_modifiedon", "Solution"."modifiedonbehalfby" AS "Solution_modifiedonbehalfby", "Solution"."organizationid" AS "Solution_organizationid", "Solution"."parentsolutionid" AS "Solution_parentsolutionid", "Solution"."pinpointassetid" AS "Solution_pinpointassetid", "Solution"."pinpointsolutiondefaultlocale" AS "Solution_pinpointsolutiondefaultlocale", "Solution"."pinpointsolutionid" AS "Solution_pinpointsolutionid", "Solution"."publisherid" AS "Solution_publisherid", "Solution"."solutionid" AS "Solution_solutionid", "Solution"."solutionpackageversion" AS "Solution_solutionpackageversion", "Solution"."solutiontype" AS "Solution_solutiontype", "Solution"."uniquename" AS "Solution_uniquename", "Solution"."version" AS "Solution_version", "Solution"."versionnumber" AS "Solution_versionnumber", "Solution_solutioncomponent_refs"."componenttype" AS "Solution_solutioncomponent_refs_componenttype", "Solution_solutioncomponent_refs"."createdby" AS "Solution_solutioncomponent_refs_createdby", "Solution_solutioncomponent_refs"."createdon" AS "Solution_solutioncomponent_refs_createdon", "Solution_solutioncomponent_refs"."createdonbehalfby" AS "Solution_solutioncomponent_refs_createdonbehalfby", "Solution_solutioncomponent_refs"."ismetadata" AS "Solution_solutioncomponent_refs_ismetadata", "Solution_solutioncomponent_refs"."modifiedby" AS "Solution_solutioncomponent_refs_modifiedby", "Solution_solutioncomponent_refs"."modifiedon" AS "Solution_solutioncomponent_refs_modifiedon", "Solution_solutioncomponent_refs"."modifiedonbehalfby" AS "Solution_solutioncomponent_refs_modifiedonbehalfby", "Solution_solutioncomponent_refs"."objectid" AS "Solution_solutioncomponent_refs_objectid", "Solution_solutioncomponent_refs"."rootcomponentbehavior" AS "Solution_solutioncomponent_refs_rootcomponentbehavior", "Solution_solutioncomponent_refs"."rootsolutioncomponentid" AS "Solution_solutioncomponent_refs_rootsolutioncomponentid", "Solution_solutioncomponent_refs"."solutioncomponentid" AS "Solution_solutioncomponent_refs_solutioncomponentid", "Solution_solutioncomponent_refs"."solutionid" AS "Solution_solutioncomponent_refs_solutionid", "Solution_solutioncomponent_refs"."versionnumber" AS "Solution_solutioncomponent_refs_versionnumber" FROM "solutionbase" "Solution" LEFT JOIN "solutioncomponentbase" "Solution_solutioncomponent_refs" ON "Solution_solutioncomponent_refs"."solutionid"="Solution"."solutionid