This paper aims to present an efficient Text-to-SQL model in resource-constrained environments. To overcome the reliance on existing resource-intensive, large-scale open-source models, we propose a novel architecture called Auto Prompt SQL (AP-SQL). AP-SQL decomposes the Text-to-SQL conversion task into three steps: schema filtering, context-based, example-based search-enhanced Text-to-SQL generation, and prompt-based schema association and SQL generation. To improve schema selection accuracy, we fine-tune a large-scale language model, and through prompt engineering techniques utilizing Chain-of-Thought (CoT) and Graph-of-Thought (GoT) templates, we enhance the model's inference ability and achieve accurate SQL generation. We demonstrate the effectiveness of AP-SQL through comprehensive evaluation results using the Spider benchmark.